Documentation ¶
Index ¶
- func NoCache(clt auth.ClientI, cacheName []string) (auth.AccessPoint, error)
- type CachingAuthClient
- func (cs *CachingAuthClient) DeleteTunnelConnection(clusterName, connName string) error
- func (cs *CachingAuthClient) GetAllTunnelConnections(opts ...services.MarshalOption) (conns []services.TunnelConnection, err error)
- func (cs *CachingAuthClient) GetCertAuthorities(ct services.CertAuthType, loadKeys bool, opts ...services.MarshalOption) (cas []services.CertAuthority, err error)
- func (cs *CachingAuthClient) GetCertAuthority(id services.CertAuthID, loadKeys bool, opts ...services.MarshalOption) (ca services.CertAuthority, err error)
- func (cs *CachingAuthClient) GetClusterConfig() (clusterConfig services.ClusterConfig, err error)
- func (cs *CachingAuthClient) GetDomainName() (clusterName string, err error)
- func (cs *CachingAuthClient) GetNamespace(name string) (namespace *services.Namespace, err error)
- func (cs *CachingAuthClient) GetNamespaces() (namespaces []services.Namespace, err error)
- func (cs *CachingAuthClient) GetNodes(namespace string, opts ...services.MarshalOption) (nodes []services.Server, err error)
- func (cs *CachingAuthClient) GetProxies() (proxies []services.Server, err error)
- func (cs *CachingAuthClient) GetReverseTunnels() (tunnels []services.ReverseTunnel, err error)
- func (cs *CachingAuthClient) GetRole(name string) (role services.Role, err error)
- func (cs *CachingAuthClient) GetRoles() (roles []services.Role, err error)
- func (cs *CachingAuthClient) GetTunnelConnections(clusterName string, opts ...services.MarshalOption) (conns []services.TunnelConnection, err error)
- func (cs *CachingAuthClient) GetUser(name string) (user services.User, err error)
- func (cs *CachingAuthClient) GetUsers() (users []services.User, err error)
- func (cs *CachingAuthClient) NewKeepAliver(ctx context.Context) (services.KeepAliver, error)
- func (cs *CachingAuthClient) UpsertAuthServer(s services.Server) error
- func (cs *CachingAuthClient) UpsertNode(s services.Server) (*services.KeepAlive, error)
- func (cs *CachingAuthClient) UpsertProxy(s services.Server) error
- func (cs *CachingAuthClient) UpsertTunnelConnection(conn services.TunnelConnection) error
- type Config
- type NewCachingAccessPoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CachingAuthClient ¶
type CachingAuthClient struct { Config *log.Entry // mutex is to check access to ttl map sync.RWMutex // contains filtered or unexported fields }
CachingAuthClient implements auth.AccessPoint interface and remembers the previously returned upstream value for each API call.
This which can be used if the upstream AccessPoint goes offline
func NewCachingAuthClient ¶
func NewCachingAuthClient(config Config) (*CachingAuthClient, error)
NewCachingAuthClient creates a new instance of CachingAuthClient using a live connection to the auth server (ap)
func (*CachingAuthClient) DeleteTunnelConnection ¶
func (cs *CachingAuthClient) DeleteTunnelConnection(clusterName, connName string) error
DeleteTunnelConnection is a part of auth.AccessPoint implementation
func (*CachingAuthClient) GetAllTunnelConnections ¶
func (cs *CachingAuthClient) GetAllTunnelConnections(opts ...services.MarshalOption) (conns []services.TunnelConnection, err error)
GetAllTunnelConnections is a part of auth.AccessPoint implementation GetAllTunnelConnections are not using recent cache, as they are designed to be called periodically and always return fresh data
func (*CachingAuthClient) GetCertAuthorities ¶
func (cs *CachingAuthClient) GetCertAuthorities(ct services.CertAuthType, loadKeys bool, opts ...services.MarshalOption) (cas []services.CertAuthority, err error)
GetCertAuthorities is a part of auth.AccessPoint implementation
func (*CachingAuthClient) GetCertAuthority ¶
func (cs *CachingAuthClient) GetCertAuthority(id services.CertAuthID, loadKeys bool, opts ...services.MarshalOption) (ca services.CertAuthority, err error)
GetCertAuthority is a part of auth.AccessPoint implementation
func (*CachingAuthClient) GetClusterConfig ¶
func (cs *CachingAuthClient) GetClusterConfig() (clusterConfig services.ClusterConfig, err error)
func (*CachingAuthClient) GetDomainName ¶
func (cs *CachingAuthClient) GetDomainName() (clusterName string, err error)
GetDomainName is a part of auth.AccessPoint implementation
func (*CachingAuthClient) GetNamespace ¶
func (cs *CachingAuthClient) GetNamespace(name string) (namespace *services.Namespace, err error)
GetNamespace returns namespace
func (*CachingAuthClient) GetNamespaces ¶
func (cs *CachingAuthClient) GetNamespaces() (namespaces []services.Namespace, err error)
GetNamespaces is a part of auth.AccessPoint implementation
func (*CachingAuthClient) GetNodes ¶
func (cs *CachingAuthClient) GetNodes(namespace string, opts ...services.MarshalOption) (nodes []services.Server, err error)
GetNodes is a part of auth.AccessPoint implementation
func (*CachingAuthClient) GetProxies ¶
func (cs *CachingAuthClient) GetProxies() (proxies []services.Server, err error)
GetProxies is a part of auth.AccessPoint implementation
func (*CachingAuthClient) GetReverseTunnels ¶
func (cs *CachingAuthClient) GetReverseTunnels() (tunnels []services.ReverseTunnel, err error)
GetReverseTunnels is not using recent cache on purpose as it's designed to be called periodically and return fresh data at all times when possible
func (*CachingAuthClient) GetRole ¶
func (cs *CachingAuthClient) GetRole(name string) (role services.Role, err error)
GetRole is a part of auth.AccessPoint implementation
func (*CachingAuthClient) GetRoles ¶
func (cs *CachingAuthClient) GetRoles() (roles []services.Role, err error)
GetRoles is a part of auth.AccessPoint implementation
func (*CachingAuthClient) GetTunnelConnections ¶
func (cs *CachingAuthClient) GetTunnelConnections(clusterName string, opts ...services.MarshalOption) (conns []services.TunnelConnection, err error)
GetTunnelConnections is a part of auth.AccessPoint implementation GetTunnelConnections are not using recent cache as they are designed to be called periodically and always return fresh data
func (*CachingAuthClient) GetUser ¶
func (cs *CachingAuthClient) GetUser(name string) (user services.User, err error)
GetUser is a part of auth.AccessPoint implementation.
func (*CachingAuthClient) GetUsers ¶
func (cs *CachingAuthClient) GetUsers() (users []services.User, err error)
GetUsers is a part of auth.AccessPoint implementation
func (*CachingAuthClient) NewKeepAliver ¶
func (cs *CachingAuthClient) NewKeepAliver(ctx context.Context) (services.KeepAliver, error)
NewKeepAliver returns a new instance of keep aliver
func (*CachingAuthClient) UpsertAuthServer ¶
func (cs *CachingAuthClient) UpsertAuthServer(s services.Server) error
UpsertAuthServer is part of auth.AccessPoint implementation
func (*CachingAuthClient) UpsertNode ¶
UpsertNode is part of auth.AccessPoint implementation
func (*CachingAuthClient) UpsertProxy ¶
func (cs *CachingAuthClient) UpsertProxy(s services.Server) error
UpsertProxy is part of auth.AccessPoint implementation
func (*CachingAuthClient) UpsertTunnelConnection ¶
func (cs *CachingAuthClient) UpsertTunnelConnection(conn services.TunnelConnection) error
UpsertTunnelConnection is a part of auth.AccessPoint implementation
type Config ¶
type Config struct { // CacheMaxTTL sets maximum TTL the cache keeps the value // in case if there is no connection to auth servers CacheMaxTTL time.Duration // RecentCacheMinTTL sets TTL for items // that were recently retrieved from auth servers // if set to 0, not turned on, if set to 1 second, // it means that value accessed within last 1 second or NotFound error // will be returned instead of using auth server RecentCacheTTL time.Duration // NeverExpires if set, never expire cache values NeverExpires bool // AccessPoint is access point for this AccessPoint auth.AccessPoint // Backend is cache backend Backend backend.Backend // Clock can be set to control time Clock clockwork.Clock // SkipPreload turns off preloading on start SkipPreload bool }
Config is CachingAuthClient config
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults checks parameters and sets default values
type NewCachingAccessPoint ¶
NewCachingAcessPoint returns new caching access point using access point policy