Documentation
¶
Overview ¶
Package cache implements event-driven cache layer that is used by auth servers, proxies and nodes.
The cache fetches resources and then subscribes to the events watcher to receive updates.
This approach allows cache to be up to date without time based expiration and avoid re-fetching all resources reducing bandwidth.
There are two types of cache backends used:
* SQLite-based in-memory used for auth nodes * SQLite-based on disk persistent cache for nodes and proxies providing resilliency in the face of auth servers failures.
Index ¶
- Constants
- type Cache
- func (c *Cache) Close() error
- func (c *Cache) GetAccessList(ctx context.Context, name string) (*accesslist.AccessList, error)
- func (c *Cache) GetAccessListMember(ctx context.Context, accessList string, memberName string) (*accesslist.AccessListMember, error)
- func (c *Cache) GetAccessLists(ctx context.Context) ([]*accesslist.AccessList, error)
- func (c *Cache) GetAllTunnelConnections(opts ...services.MarshalOption) (conns []types.TunnelConnection, err error)
- func (c *Cache) GetApp(ctx context.Context, name string) (types.Application, error)
- func (c *Cache) GetAppSession(ctx context.Context, req types.GetAppSessionRequest) (types.WebSession, error)
- func (c *Cache) GetApplicationServers(ctx context.Context, namespace string) ([]types.AppServer, error)
- func (c *Cache) GetApps(ctx context.Context) ([]types.Application, error)
- func (c *Cache) GetAuthPreference(ctx context.Context) (types.AuthPreference, error)
- func (c *Cache) GetAuthServers() ([]types.Server, error)
- func (c *Cache) GetCertAuthorities(ctx context.Context, caType types.CertAuthType, loadSigningKeys bool) ([]types.CertAuthority, error)
- func (c *Cache) GetCertAuthority(ctx context.Context, id types.CertAuthID, loadSigningKeys bool) (types.CertAuthority, error)
- func (c *Cache) GetClusterAuditConfig(ctx context.Context, opts ...services.MarshalOption) (types.ClusterAuditConfig, error)
- func (c *Cache) GetClusterName(opts ...services.MarshalOption) (types.ClusterName, error)
- func (c *Cache) GetClusterNetworkingConfig(ctx context.Context, opts ...services.MarshalOption) (types.ClusterNetworkingConfig, error)
- func (c *Cache) GetDatabase(ctx context.Context, name string) (types.Database, error)
- func (c *Cache) GetDatabaseServers(ctx context.Context, namespace string, opts ...services.MarshalOption) ([]types.DatabaseServer, error)
- func (c *Cache) GetDatabases(ctx context.Context) ([]types.Database, error)
- func (c *Cache) GetDiscoveryConfig(ctx context.Context, name string) (*discoveryconfig.DiscoveryConfig, error)
- func (c *Cache) GetInstaller(ctx context.Context, name string) (types.Installer, error)
- func (c *Cache) GetInstallers(ctx context.Context) ([]types.Installer, error)
- func (c *Cache) GetIntegration(ctx context.Context, name string) (types.Integration, error)
- func (c *Cache) GetKubernetesCluster(ctx context.Context, name string) (types.KubeCluster, error)
- func (c *Cache) GetKubernetesClusters(ctx context.Context) ([]types.KubeCluster, error)
- func (c *Cache) GetKubernetesServers(ctx context.Context) ([]types.KubeServer, error)
- func (c *Cache) GetLock(ctx context.Context, name string) (types.Lock, error)
- func (c *Cache) GetLocks(ctx context.Context, inForceOnly bool, targets ...types.LockTarget) ([]types.Lock, error)
- func (c *Cache) GetNamespace(name string) (*types.Namespace, error)
- func (c *Cache) GetNamespaces() ([]types.Namespace, error)
- func (c *Cache) GetNetworkRestrictions(ctx context.Context) (types.NetworkRestrictions, error)
- func (c *Cache) GetNode(ctx context.Context, namespace, name string) (types.Server, error)
- func (c *Cache) GetNodes(ctx context.Context, namespace string) ([]types.Server, error)
- func (c *Cache) GetOktaAssignment(ctx context.Context, name string) (types.OktaAssignment, error)
- func (c *Cache) GetOktaImportRule(ctx context.Context, name string) (types.OktaImportRule, error)
- func (c *Cache) GetProxies() ([]types.Server, error)
- func (c *Cache) GetRemoteCluster(clusterName string) (types.RemoteCluster, error)
- func (c *Cache) GetRemoteClusters(opts ...services.MarshalOption) ([]types.RemoteCluster, error)
- func (c *Cache) GetReverseTunnels(ctx context.Context, opts ...services.MarshalOption) ([]types.ReverseTunnel, error)
- func (c *Cache) GetRole(ctx context.Context, name string) (types.Role, error)
- func (c *Cache) GetRoles(ctx context.Context) ([]types.Role, error)
- func (c *Cache) GetSAMLIdPServiceProvider(ctx context.Context, name string) (types.SAMLIdPServiceProvider, error)
- func (c *Cache) GetSAMLIdPSession(ctx context.Context, req types.GetSAMLIdPSessionRequest) (types.WebSession, error)
- func (c *Cache) GetSecurityAuditQueries(ctx context.Context) ([]*secreports.AuditQuery, error)
- func (c *Cache) GetSecurityAuditQuery(ctx context.Context, name string) (*secreports.AuditQuery, error)
- func (c *Cache) GetSecurityReport(ctx context.Context, name string) (*secreports.Report, error)
- func (c *Cache) GetSecurityReportState(ctx context.Context, name string) (*secreports.ReportState, error)
- func (c *Cache) GetSecurityReports(ctx context.Context) ([]*secreports.Report, error)
- func (c *Cache) GetSecurityReportsStates(ctx context.Context) ([]*secreports.ReportState, error)
- func (c *Cache) GetSessionRecordingConfig(ctx context.Context, opts ...services.MarshalOption) (types.SessionRecordingConfig, error)
- func (c *Cache) GetSnowflakeSession(ctx context.Context, req types.GetSnowflakeSessionRequest) (types.WebSession, error)
- func (c *Cache) GetStaticTokens() (types.StaticTokens, error)
- func (c *Cache) GetToken(ctx context.Context, name string) (types.ProvisionToken, error)
- func (c *Cache) GetTokens(ctx context.Context) ([]types.ProvisionToken, error)
- func (c *Cache) GetTunnelConnections(clusterName string, opts ...services.MarshalOption) ([]types.TunnelConnection, error)
- func (c *Cache) GetUIConfig(ctx context.Context) (types.UIConfig, error)
- func (c *Cache) GetUser(ctx context.Context, name string, withSecrets bool) (types.User, error)
- func (c *Cache) GetUserGroup(ctx context.Context, name string) (types.UserGroup, error)
- func (c *Cache) GetUserLoginState(ctx context.Context, name string) (*userloginstate.UserLoginState, error)
- func (c *Cache) GetUserLoginStates(ctx context.Context) ([]*userloginstate.UserLoginState, error)
- func (c *Cache) GetUsers(ctx context.Context, withSecrets bool) ([]types.User, error)
- func (c *Cache) GetWebSession(ctx context.Context, req types.GetWebSessionRequest) (types.WebSession, error)
- func (c *Cache) GetWebToken(ctx context.Context, req types.GetWebTokenRequest) (types.WebToken, error)
- func (c *Cache) GetWindowsDesktopService(ctx context.Context, name string) (types.WindowsDesktopService, error)
- func (c *Cache) GetWindowsDesktopServices(ctx context.Context) ([]types.WindowsDesktopService, error)
- func (c *Cache) GetWindowsDesktops(ctx context.Context, filter types.WindowsDesktopFilter) ([]types.WindowsDesktop, error)
- func (c *Cache) ListAccessListMembers(ctx context.Context, accessListName string, pageSize int, pageToken string) (members []*accesslist.AccessListMember, nextToken string, err error)
- func (c *Cache) ListAccessListReviews(ctx context.Context, accessList string, pageSize int, pageToken string) (reviews []*accesslist.Review, nextToken string, err error)
- func (c *Cache) ListAccessLists(ctx context.Context, pageSize int, nextToken string) ([]*accesslist.AccessList, string, error)
- func (c *Cache) ListAppSessions(ctx context.Context, pageSize int, pageToken, user string) ([]types.WebSession, string, error)
- func (c *Cache) ListDiscoveryConfigs(ctx context.Context, pageSize int, nextKey string) ([]*discoveryconfig.DiscoveryConfig, string, error)
- func (c *Cache) ListIntegrations(ctx context.Context, pageSize int, nextKey string) ([]types.Integration, string, error)
- func (c *Cache) ListOktaAssignments(ctx context.Context, pageSize int, nextKey string) ([]types.OktaAssignment, string, error)
- func (c *Cache) ListOktaImportRules(ctx context.Context, pageSize int, nextKey string) ([]types.OktaImportRule, string, error)
- func (c *Cache) ListResources(ctx context.Context, req proto.ListResourcesRequest) (*types.ListResourcesResponse, error)
- func (c *Cache) ListSAMLIdPServiceProviders(ctx context.Context, pageSize int, nextKey string) ([]types.SAMLIdPServiceProvider, string, error)
- func (c *Cache) ListSecurityAuditQueries(ctx context.Context, pageSize int, nextKey string) ([]*secreports.AuditQuery, string, error)
- func (c *Cache) ListSecurityReports(ctx context.Context, pageSize int, nextKey string) ([]*secreports.Report, string, error)
- func (c *Cache) ListSecurityReportsStates(ctx context.Context, pageSize int, nextKey string) ([]*secreports.ReportState, string, error)
- func (c *Cache) ListUserGroups(ctx context.Context, pageSize int, nextKey string) ([]types.UserGroup, string, error)
- func (c *Cache) ListUsers(ctx context.Context, pageSize int, nextToken string, withSecrets bool) ([]types.User, string, error)
- func (c *Cache) ListWindowsDesktopServices(ctx context.Context, req types.ListWindowsDesktopServicesRequest) (*types.ListWindowsDesktopServicesResponse, error)
- func (c *Cache) ListWindowsDesktops(ctx context.Context, req types.ListWindowsDesktopsRequest) (*types.ListWindowsDesktopsResponse, error)
- func (c *Cache) NewStream(ctx context.Context, watch types.Watch) (stream.Stream[types.Event], error)
- func (c *Cache) NewWatcher(ctx context.Context, watch types.Watch) (types.Watcher, error)
- func (c *Cache) Start() error
- type Config
- func ForApps(cfg Config) Config
- func ForAuth(cfg Config) Config
- func ForDatabases(cfg Config) Config
- func ForDiscovery(cfg Config) Config
- func ForKubernetes(cfg Config) Config
- func ForNode(cfg Config) Config
- func ForOkta(cfg Config) Config
- func ForOldRemoteProxy(cfg Config) Config
- func ForProxy(cfg Config) Config
- func ForRemoteProxy(cfg Config) Config
- func ForWindowsDesktop(cfg Config) Config
- type Event
- type SetupConfigFn
Constants ¶
const ( // EventProcessed is emitted whenever event is processed EventProcessed = "event_processed" // WatcherStarted is emitted when a new event watcher is started WatcherStarted = "watcher_started" // WatcherFailed is emitted when event watcher has failed WatcherFailed = "watcher_failed" // Reloading is emitted when an error occurred watching events // and the cache is waiting to create a new watcher Reloading = "reloading_cache" // RelativeExpiry notifies that relative expiry operations have // been run. RelativeExpiry = "relative_expiry" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Config // Entry is a logging entry Logger *log.Entry // contains filtered or unexported fields }
Cache implements auth.Cache interface and remembers the previously returned upstream value for each API call.
This which can be used if the upstream AccessPoint goes offline
func (*Cache) GetAccessList ¶
func (c *Cache) GetAccessList(ctx context.Context, name string) (*accesslist.AccessList, error)
GetAccessList returns the specified access list resource.
func (*Cache) GetAccessListMember ¶
func (c *Cache) GetAccessListMember(ctx context.Context, accessList string, memberName string) (*accesslist.AccessListMember, error)
GetAccessListMember returns the specified access list member resource. May return a DynamicAccessListError if the requested access list has an implicit member list and the underlying implementation does not have enough information to compute the dynamic member record.
func (*Cache) GetAccessLists ¶
func (c *Cache) GetAccessLists(ctx context.Context) ([]*accesslist.AccessList, error)
GetAccessLists returns a list of all access lists.
func (*Cache) GetAllTunnelConnections ¶
func (c *Cache) GetAllTunnelConnections(opts ...services.MarshalOption) (conns []types.TunnelConnection, err error)
GetAllTunnelConnections is a part of auth.Cache implementation
func (*Cache) GetAppSession ¶
func (c *Cache) GetAppSession(ctx context.Context, req types.GetAppSessionRequest) (types.WebSession, error)
GetAppSession gets an application web session.
func (*Cache) GetApplicationServers ¶
func (c *Cache) GetApplicationServers(ctx context.Context, namespace string) ([]types.AppServer, error)
GetApplicationServers returns all registered application servers.
func (*Cache) GetAuthPreference ¶
GetAuthPreference gets the cluster authentication config.
func (*Cache) GetAuthServers ¶
GetAuthServers returns a list of registered servers
func (*Cache) GetCertAuthorities ¶
func (c *Cache) GetCertAuthorities(ctx context.Context, caType types.CertAuthType, loadSigningKeys bool) ([]types.CertAuthority, error)
GetCertAuthorities returns a list of authorities of a given type loadSigningKeys controls whether signing keys should be loaded or not
func (*Cache) GetCertAuthority ¶
func (c *Cache) GetCertAuthority(ctx context.Context, id types.CertAuthID, loadSigningKeys bool) (types.CertAuthority, error)
GetCertAuthority returns certificate authority by given id. Parameter loadSigningKeys controls if signing keys are loaded
func (*Cache) GetClusterAuditConfig ¶
func (c *Cache) GetClusterAuditConfig(ctx context.Context, opts ...services.MarshalOption) (types.ClusterAuditConfig, error)
GetClusterAuditConfig gets ClusterAuditConfig from the backend.
func (*Cache) GetClusterName ¶
func (c *Cache) GetClusterName(opts ...services.MarshalOption) (types.ClusterName, error)
GetClusterName gets the name of the cluster from the backend.
func (*Cache) GetClusterNetworkingConfig ¶
func (c *Cache) GetClusterNetworkingConfig(ctx context.Context, opts ...services.MarshalOption) (types.ClusterNetworkingConfig, error)
GetClusterNetworkingConfig gets ClusterNetworkingConfig from the backend.
func (*Cache) GetDatabase ¶
GetDatabase returns the specified database resource.
func (*Cache) GetDatabaseServers ¶
func (c *Cache) GetDatabaseServers(ctx context.Context, namespace string, opts ...services.MarshalOption) ([]types.DatabaseServer, error)
GetDatabaseServers returns all registered database proxy servers.
func (*Cache) GetDatabases ¶
GetDatabases returns all database resources.
func (*Cache) GetDiscoveryConfig ¶
func (c *Cache) GetDiscoveryConfig(ctx context.Context, name string) (*discoveryconfig.DiscoveryConfig, error)
GetDiscoveryConfig returns the specified DiscoveryConfig resource.
func (*Cache) GetInstaller ¶
GetInstaller gets the installer script resource for the cluster
func (*Cache) GetInstallers ¶
GetInstallers gets all the installer script resources for the cluster
func (*Cache) GetIntegration ¶
GetIntegration returns the specified Integration resources.
func (*Cache) GetKubernetesCluster ¶
GetKubernetesCluster returns the specified kubernetes cluster resource.
func (*Cache) GetKubernetesClusters ¶
GetKubernetesClusters returns all kubernetes cluster resources.
func (*Cache) GetKubernetesServers ¶
GetKubernetesServers is a part of auth.Cache implementation
func (*Cache) GetLocks ¶
func (c *Cache) GetLocks(ctx context.Context, inForceOnly bool, targets ...types.LockTarget) ([]types.Lock, error)
GetLocks gets all/in-force locks that match at least one of the targets when specified.
func (*Cache) GetNamespace ¶
GetNamespace returns namespace
func (*Cache) GetNamespaces ¶
GetNamespaces is a part of auth.Cache implementation
func (*Cache) GetNetworkRestrictions ¶
GetNetworkRestrictions gets the network restrictions.
func (*Cache) GetOktaAssignment ¶
GetOktaAssignment returns the specified Okta assignment resources.
func (*Cache) GetOktaImportRule ¶
GetOktaImportRule returns the specified Okta import rule resources.
func (*Cache) GetProxies ¶
GetProxies is a part of auth.Cache implementation
func (*Cache) GetRemoteCluster ¶
func (c *Cache) GetRemoteCluster(clusterName string) (types.RemoteCluster, error)
GetRemoteCluster returns a remote cluster by name
func (*Cache) GetRemoteClusters ¶
func (c *Cache) GetRemoteClusters(opts ...services.MarshalOption) ([]types.RemoteCluster, error)
GetRemoteClusters returns a list of remote clusters
func (*Cache) GetReverseTunnels ¶
func (c *Cache) GetReverseTunnels(ctx context.Context, opts ...services.MarshalOption) ([]types.ReverseTunnel, error)
GetReverseTunnels is a part of auth.Cache implementation
func (*Cache) GetSAMLIdPServiceProvider ¶
func (c *Cache) GetSAMLIdPServiceProvider(ctx context.Context, name string) (types.SAMLIdPServiceProvider, error)
GetSAMLIdPServiceProvider returns the specified SAML IdP service provider resources.
func (*Cache) GetSAMLIdPSession ¶
func (c *Cache) GetSAMLIdPSession(ctx context.Context, req types.GetSAMLIdPSessionRequest) (types.WebSession, error)
GetSAMLIdPSession gets a SAML IdP session.
func (*Cache) GetSecurityAuditQueries ¶
func (c *Cache) GetSecurityAuditQueries(ctx context.Context) ([]*secreports.AuditQuery, error)
GetSecurityAuditQueries returns a list of all audit query resources.
func (*Cache) GetSecurityAuditQuery ¶
func (c *Cache) GetSecurityAuditQuery(ctx context.Context, name string) (*secreports.AuditQuery, error)
GetSecurityAuditQuery returns the specified audit query resource.
func (*Cache) GetSecurityReport ¶
GetSecurityReport returns the specified security report resource.
func (*Cache) GetSecurityReportState ¶
func (c *Cache) GetSecurityReportState(ctx context.Context, name string) (*secreports.ReportState, error)
GetSecurityReportState returns the specified security report state resource.
func (*Cache) GetSecurityReports ¶
GetSecurityReports returns a list of all security report resources.
func (*Cache) GetSecurityReportsStates ¶
func (c *Cache) GetSecurityReportsStates(ctx context.Context) ([]*secreports.ReportState, error)
GetSecurityReportsStates returns a list of all security report resources.
func (*Cache) GetSessionRecordingConfig ¶
func (c *Cache) GetSessionRecordingConfig(ctx context.Context, opts ...services.MarshalOption) (types.SessionRecordingConfig, error)
GetSessionRecordingConfig gets session recording configuration.
func (*Cache) GetSnowflakeSession ¶
func (c *Cache) GetSnowflakeSession(ctx context.Context, req types.GetSnowflakeSessionRequest) (types.WebSession, error)
GetSnowflakeSession gets Snowflake web session.
func (*Cache) GetStaticTokens ¶
func (c *Cache) GetStaticTokens() (types.StaticTokens, error)
GetStaticTokens gets the list of static tokens used to provision nodes.
func (*Cache) GetTunnelConnections ¶
func (c *Cache) GetTunnelConnections(clusterName string, opts ...services.MarshalOption) ([]types.TunnelConnection, error)
GetTunnelConnections is a part of auth.Cache implementation
func (*Cache) GetUIConfig ¶
func (*Cache) GetUserGroup ¶
GetUserGroup returns the specified user group resources.
func (*Cache) GetUserLoginState ¶
func (c *Cache) GetUserLoginState(ctx context.Context, name string) (*userloginstate.UserLoginState, error)
GetUserLoginState returns the specified user login state resource.
func (*Cache) GetUserLoginStates ¶
func (c *Cache) GetUserLoginStates(ctx context.Context) ([]*userloginstate.UserLoginState, error)
GetUserLoginStates returns the all user login state resources.
func (*Cache) GetWebSession ¶
func (c *Cache) GetWebSession(ctx context.Context, req types.GetWebSessionRequest) (types.WebSession, error)
GetWebSession gets a regular web session.
func (*Cache) GetWebToken ¶
func (c *Cache) GetWebToken(ctx context.Context, req types.GetWebTokenRequest) (types.WebToken, error)
GetWebToken gets a web token.
func (*Cache) GetWindowsDesktopService ¶
func (c *Cache) GetWindowsDesktopService(ctx context.Context, name string) (types.WindowsDesktopService, error)
GetWindowsDesktopService returns a registered Windows desktop service by name.
func (*Cache) GetWindowsDesktopServices ¶
func (c *Cache) GetWindowsDesktopServices(ctx context.Context) ([]types.WindowsDesktopService, error)
GetWindowsDesktopServices returns all registered Windows desktop services.
func (*Cache) GetWindowsDesktops ¶
func (c *Cache) GetWindowsDesktops(ctx context.Context, filter types.WindowsDesktopFilter) ([]types.WindowsDesktop, error)
GetWindowsDesktops returns all registered Windows desktop hosts.
func (*Cache) ListAccessListMembers ¶
func (c *Cache) ListAccessListMembers(ctx context.Context, accessListName string, pageSize int, pageToken string) (members []*accesslist.AccessListMember, nextToken string, err error)
ListAccessListMembers returns a paginated list of all access list members. May return a DynamicAccessListError if the requested access list has an implicit member list and the underlying implementation does not have enough information to compute the dynamic member list.
func (*Cache) ListAccessListReviews ¶
func (c *Cache) ListAccessListReviews(ctx context.Context, accessList string, pageSize int, pageToken string) (reviews []*accesslist.Review, nextToken string, err error)
ListAccessListReviews will list access list reviews for a particular access list.
func (*Cache) ListAccessLists ¶
func (c *Cache) ListAccessLists(ctx context.Context, pageSize int, nextToken string) ([]*accesslist.AccessList, string, error)
ListAccessLists returns a paginated list of access lists.
func (*Cache) ListAppSessions ¶
func (c *Cache) ListAppSessions(ctx context.Context, pageSize int, pageToken, user string) ([]types.WebSession, string, error)
ListAppSessions returns a page of application web sessions.
func (*Cache) ListDiscoveryConfigs ¶
func (c *Cache) ListDiscoveryConfigs(ctx context.Context, pageSize int, nextKey string) ([]*discoveryconfig.DiscoveryConfig, string, error)
ListDiscoveryConfigs returns a paginated list of all DiscoveryConfig resources.
func (*Cache) ListIntegrations ¶
func (c *Cache) ListIntegrations(ctx context.Context, pageSize int, nextKey string) ([]types.Integration, string, error)
ListIntegrations returns a paginated list of all Integrations resources.
func (*Cache) ListOktaAssignments ¶
func (c *Cache) ListOktaAssignments(ctx context.Context, pageSize int, nextKey string) ([]types.OktaAssignment, string, error)
ListOktaAssignments returns a paginated list of all Okta assignment resources.
func (*Cache) ListOktaImportRules ¶
func (c *Cache) ListOktaImportRules(ctx context.Context, pageSize int, nextKey string) ([]types.OktaImportRule, string, error)
ListOktaImportRules returns a paginated list of all Okta import rule resources.
func (*Cache) ListResources ¶
func (c *Cache) ListResources(ctx context.Context, req proto.ListResourcesRequest) (*types.ListResourcesResponse, error)
ListResources is a part of auth.Cache implementation
func (*Cache) ListSAMLIdPServiceProviders ¶
func (c *Cache) ListSAMLIdPServiceProviders(ctx context.Context, pageSize int, nextKey string) ([]types.SAMLIdPServiceProvider, string, error)
ListSAMLIdPServiceProviders returns a paginated list of SAML IdP service provider resources.
func (*Cache) ListSecurityAuditQueries ¶
func (c *Cache) ListSecurityAuditQueries(ctx context.Context, pageSize int, nextKey string) ([]*secreports.AuditQuery, string, error)
ListSecurityAuditQueries returns a paginated list of all audit query resources.
func (*Cache) ListSecurityReports ¶
func (c *Cache) ListSecurityReports(ctx context.Context, pageSize int, nextKey string) ([]*secreports.Report, string, error)
ListSecurityReports returns a paginated list of all security report resources.
func (*Cache) ListSecurityReportsStates ¶
func (c *Cache) ListSecurityReportsStates(ctx context.Context, pageSize int, nextKey string) ([]*secreports.ReportState, string, error)
ListSecurityReportsStates returns a paginated list of all security report resources.
func (*Cache) ListUserGroups ¶
func (c *Cache) ListUserGroups(ctx context.Context, pageSize int, nextKey string) ([]types.UserGroup, string, error)
ListUserGroups returns a paginated list of user group resources.
func (*Cache) ListUsers ¶
func (c *Cache) ListUsers(ctx context.Context, pageSize int, nextToken string, withSecrets bool) ([]types.User, string, error)
ListUsers returns a page of users.
func (*Cache) ListWindowsDesktopServices ¶
func (c *Cache) ListWindowsDesktopServices(ctx context.Context, req types.ListWindowsDesktopServicesRequest) (*types.ListWindowsDesktopServicesResponse, error)
ListWindowsDesktopServices returns all registered Windows desktop hosts.
func (*Cache) ListWindowsDesktops ¶
func (c *Cache) ListWindowsDesktops(ctx context.Context, req types.ListWindowsDesktopsRequest) (*types.ListWindowsDesktopsResponse, error)
ListWindowsDesktops returns all registered Windows desktop hosts.
func (*Cache) NewStream ¶
func (c *Cache) NewStream(ctx context.Context, watch types.Watch) (stream.Stream[types.Event], error)
NewStream is equivalent to NewWatcher except that it represents the event stream as a stream.Stream rather than a channel. Watcher style event handling is generally more common, but this API may be preferable for usecases where *many* event streams need to be allocated as it is slightly more resource-efficient.
func (*Cache) NewWatcher ¶
NewWatcher returns a new event watcher. In case of a cache this watcher will return events as seen by the cache, not the backend. This feature allows auth server to handle subscribers connected to the in-memory caches instead of reading from the backend.
type Config ¶
type Config struct { // Context is context for parent operations Context context.Context // Watches provides a list of resources // for the cache to watch Watches []types.WatchKind // FanoutShards is the number of event fanout shards to allocate FanoutShards int // Events provides events watchers Events types.Events // Trust is a service providing information about certificate // authorities Trust services.Trust // ClusterConfig is a cluster configuration service ClusterConfig services.ClusterConfiguration // Provisioner is a provisioning service Provisioner services.Provisioner // Users is a users service Users services.UsersService // Access is an access service Access services.Access // DynamicAccess is a dynamic access service DynamicAccess services.DynamicAccessCore // Presence is a presence service Presence services.Presence // Restrictions is a restrictions service Restrictions services.Restrictions // Apps is an apps service. Apps services.Apps // Kubernetes is an kubernetes service. Kubernetes services.Kubernetes // DatabaseServices is a DatabaseService service. DatabaseServices services.DatabaseServices // Databases is a databases service. Databases services.Databases // SAMLIdPSession holds SAML IdP sessions. SAMLIdPSession services.SAMLIdPSession // SnowflakeSession holds Snowflake sessions. SnowflakeSession services.SnowflakeSession // AppSession holds application sessions. AppSession services.AppSession // WebSession holds regular web sessions. WebSession types.WebSessionInterface // WebToken holds web tokens. WebToken types.WebTokenInterface // WindowsDesktops is a windows desktop service. WindowsDesktops services.WindowsDesktops // SAMLIdPServiceProviders is a SAML IdP service providers service. SAMLIdPServiceProviders services.SAMLIdPServiceProviders // UserGroups is a user groups service. UserGroups services.UserGroups // Okta is an Okta service. Okta services.Okta // Integrations is an Integrations service. Integrations services.Integrations // DiscoveryConfigs is a DiscoveryConfigs service. DiscoveryConfigs services.DiscoveryConfigs // UserLoginStates is the user login state service. UserLoginStates services.UserLoginStates // SecEvents is the security report service. SecReports services.SecReports // AccessLists is the access lists service. AccessLists services.AccessLists // Backend is a backend for local cache Backend backend.Backend // MaxRetryPeriod is the maximum period between cache retries on failures MaxRetryPeriod time.Duration // WatcherInitTimeout is the maximum acceptable delay for an // OpInit after a watcher has been started (default=1m). WatcherInitTimeout time.Duration // CacheInitTimeout is the maximum amount of time that cache.New // will block, waiting for initialization (default=20s). CacheInitTimeout time.Duration // RelativeExpiryCheckInterval determines how often the cache performs special // "relative expiration" checks which are used to compensate for real backends // that have suffer from overly lazy ttl'ing of resources. RelativeExpiryCheckInterval time.Duration // RelativeExpiryLimit determines the maximum number of nodes that may be // removed during relative expiration. RelativeExpiryLimit int // EventsC is a channel for event notifications, // used in tests EventsC chan Event // Clock can be set to control time, // uses runtime clock by default Clock clockwork.Clock // Component is a component used in logs Component string // MetricComponent is a component used in metrics MetricComponent string // QueueSize is a desired queue Size QueueSize int // Tracer is used to create spans Tracer oteltrace.Tracer // Unstarted indicates that the cache should not be started during New. The // cache is usable before it's started, but it will always hit the backend. Unstarted bool // DisablePartialHealth disables the default mode in which cache can become // healthy even if some of the requested resource kinds aren't // supported by the event source. DisablePartialHealth bool // contains filtered or unexported fields }
Config defines cache configuration parameters
func ForDatabases ¶
ForDatabases sets up watch configuration for database proxy servers.
func ForDiscovery ¶
ForDiscovery sets up watch configuration for discovery servers.
func ForKubernetes ¶
ForKubernetes sets up watch configuration for a kubernetes service.
func ForOldRemoteProxy ¶
ForOldRemoteProxy sets up watch configuration for older remote proxies. The types.WatchKind defined here allow for backwards incompatible changes and should only be updated to match the previous values of ForRemoteProxy **prior** to the breaking change. See the comment of ForRemoteProxy for instructions on how to update without bricking remote proxy caches.
func ForRemoteProxy ¶
ForRemoteProxy sets up watch configuration for remote proxies.
**WARNING**: In order to add a new types.WatchKind below there are a few things that must be done to ensure that backward incompatible changes don't render a remote cluster permanently unhealthy. First, the cfg.Watches of ForOldRemoteProxy must be replaced with the current cfg.Watches of ForRemoteProxy. Next, the version used by `lib/reversetunnel/srv/go` to determine whether to use ForRemoteProxy or ForOldRemoteProxy must be updated to be the release in which the new resource(s) will exist in. Finally, add the new types.WatchKind below. Also note that this only designed to occur once per major version.
func ForWindowsDesktop ¶
ForWindowsDesktop sets up watch configuration for a Windows desktop service.
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults checks parameters and sets default values
type Event ¶
type Event struct { // Type is event type Type string // Event is event processed // by the event cycle Event types.Event }
Event is event used in tests
type SetupConfigFn ¶
SetupConfigFn is a function that sets up configuration for cache