$ wechaty-token --help
wechaty-token <subcommand>
> Wechaty utility for discovering and generating tokens
where <subcommand> can be one of:
- generate - Generate a new Wechaty Token
- discover - Wechaty TOKEN Service Discovery
For more help, try running `wechaty-token <subcommand> --help`
Wechaty Token Discovery
$ wechaty-token discover --help
wechaty-token discover
> Wechaty TOKEN Service Discovery
ARGUMENTS:
<str> - Wechaty Puppet Service TOKEN
FLAGS:
--help, -h - show help
$ wechaty-token generate --help
wechaty-token generate
> Generate a new Wechaty Token
OPTIONS:
--type, -t <str> - The type of the Wechaty Puppet Service [optional]
FLAGS:
--help, -h - show help
Example:
# Generate a UUID token (`uuid` will be the default type)
$ wechaty-token generate
uuid_1fab726b-e3d3-40ce-8b7b-d3bd8c9fd280
# Generate token with type `foo`
$ wechaty-token generate --type foo
foo_1fab726b-e3d3-40ce-8b7b-d3bd8c9fd280
gRPC Resolver Usage
We now can use wechaty:///${TOKEN} as gRPC address for Wechaty Service Token Discovery.
The WechatyResolver is for resolve the above address and help gRPC to connect to the right host and port.
import { WechatyResolver } from 'wechaty-token'
WechatyResolver.setup()
// That's it! You can use `wechaty:///${TOKEN}` as gRPC address now!
// const routeguide = grpc.loadPackageDefinition(packageDefinition).routeguide;
// client = new routeguide.RouteGuide('wechaty:///${TOKEN}',
// grpc.credentials.createInsecure());
// See: https://grpc.io/docs/languages/node/basics/
wechaty-token
Wechaty Token Based Authentication Manager
Install
CLI Usage
Wechaty Token Discovery
Example:
Generate Wechaty Token
Example:
gRPC Resolver Usage
We now can use
wechaty:///${TOKEN}as gRPC address for Wechaty Service Token Discovery.The
WechatyResolveris for resolve the above address and help gRPC to connect to the right host and port.See:
History
master v1.0 (Nov 28, 2021)
JSON.stringifyformatv0.5 (Sep 8, 2021)
SNI_UUIDSNIwill be used as Server Indicator Name (SNI) when we are using TLSUUIDis a standard UUID format (v4)wechatyToken.snisupport.v0.4 (Aug 15, 2021)
cockatielto implementRetryPolicynockto implement HTTP unit testingv0.2 master (Aug 2, 2021)
wechaty-tokenCLI releasedxdslike schemawechaty:///uuid_TOKENfor gRPC clientv0.0.1 (Aug 1, 2021)
Inited
Author
Huan LI (李卓桓), Google Developer Expert (Machine Learning), zixia@zixia.net
Copyright & License