Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRoleToken ¶
func NewRoleToken(tok zmssvctoken.Token, domain string, opts RoleTokenOptions) *roleToken
NewRoleToken returns a RoleToken implementation based on principal tokens retrieved from the supplied Token implementation for the supplied domain and options.
func NewRoleTokenFromCert ¶
func NewRoleTokenFromCert(certFile, keyFile, domain string, opts RoleTokenOptions) *roleToken
NewRoleTokenFromCert returns a RoleToken implementation based on principal service certificate retrieved from the supplied service certificate for the supplied domain and options.
Types ¶
type RoleToken ¶
RoleToken is a mechanism to get a role token (ztoken) as a string. It guarantees that the returned token has not expired.
type RoleTokenOptions ¶
type RoleTokenOptions struct { BaseZTSURL string // the base ZTS URL to use Role string // the single role for which a token is required MinExpire time.Duration // the minimum expiry of the token in (server default if zero) MaxExpire time.Duration // the maximum expiry of the token (server default if zero) AuthHeader string // Auth Header to use while making ZMS calls CACert []byte // Optional CA certpem to validate the ZTS server }
RoleTokenOptions allows the caller to supply additional options for getting a role token. The zero-value is a valid configuration.
Click to show internal directories.
Click to hide internal directories.