Documentation ¶
Overview ¶
Package token implements an example of authorization token encoding/decoding that can be used in RPC headers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct { // Secret is used by the server to authenticate the user Secret string `json:"secret"` // Username is used by the server to assign roles in the metadata for authorization Username string `json:"username"` }
Token is a mock authorization token sent by the client as part of the RPC headers, and used by the server for authorization against a predefined policy.
Click to show internal directories.
Click to hide internal directories.