Documentation
¶
Index ¶
- type AccessToken
- type AccessTokenClient
- type BaseTokenClient
- type Client
- func (c *Client) SetProxy(proxyURL string)
- func (c *Client) SetTLSConfig(tlsConfig *tls.Config)
- func (c *Client) Transport() *http.Transport
- func (c *Client) UpdateCachePeriodically(ctx context.Context, tk GetToken, interval time.Duration)
- func (c *Client) WatchCertificateFiles(ctx context.Context, certFile, keyFile string) error
- type GetToken
- type RoleToken
- type RoleTokenClient
- type Token
- type TokenGetterFunc
- type ZTSClientInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken struct {
Token *zts.AccessTokenResponse
ExpiryTime int64
Duration time.Duration
}
func (*AccessToken) GetDuration ¶
func (at *AccessToken) GetDuration() time.Duration
func (*AccessToken) GetExpiryTime ¶
func (at *AccessToken) GetExpiryTime() int64
func (*AccessToken) GetToken ¶
func (at *AccessToken) GetToken() *zts.AccessTokenResponse
type AccessTokenClient ¶
type AccessTokenClient struct {
*BaseTokenClient[*AccessToken]
}
func NewAccessTokenClient ¶
func NewAccessTokenClient(ctx context.Context, ztsUrl, pem, key string) (*AccessTokenClient, context.CancelFunc)
func NewAccessTokenClientSetCacheUpdateDuration ¶
func NewAccessTokenClientSetCacheUpdateDuration(ctx context.Context, ztsUrl, pem, key string, cacheRefreshDuration time.Duration) (*AccessTokenClient, context.CancelFunc)
type BaseTokenClient ¶
func (*BaseTokenClient[T]) GetToken ¶
func (btc *BaseTokenClient[T]) GetToken(domain string, roles []string) (T, error)
func (*BaseTokenClient[T]) GetTokenWithExpire ¶
func (btc *BaseTokenClient[T]) GetTokenWithExpire(domain string, roles []string, exp int32) (T, error)
type Client ¶
type Client struct {
ZTS ZTSClientInterface
Cache *cache.Cache
Tok GetToken
}
func (*Client) SetTLSConfig ¶
func (*Client) UpdateCachePeriodically ¶
type RoleTokenClient ¶
type RoleTokenClient struct {
*BaseTokenClient[*RoleToken]
}
func NewRoleTokenClient ¶
func NewRoleTokenClient(ctx context.Context, ztsUrl, pem, key string) (*RoleTokenClient, context.CancelFunc)
func NewRoleTokenClientSetCacheUpdateDuration ¶
func NewRoleTokenClientSetCacheUpdateDuration(ctx context.Context, ztsUrl, pem, key string, cacheRefreshDuration time.Duration) (*RoleTokenClient, context.CancelFunc)
type TokenGetterFunc ¶
type ZTSClientInterface ¶
type ZTSClientInterface interface {
PostAccessTokenRequest(req zts.AccessTokenRequest) (*zts.AccessTokenResponse, error)
GetRoleToken(domain zts.DomainName, roles zts.EntityList, minExpiryTime *int32, maxExpiryTime *int32, proxyForPrincipal zts.EntityName) (*zts.RoleToken, error)
SetTransport(transport *http.Transport)
Transport() *http.Transport
URL() string
SetURL(url string)
}
Click to show internal directories.
Click to hide internal directories.