Documentation
¶
Overview ¶
Package authdb contains methods to work with authdb.
Index ¶
- type CachingPermissionsProvider
- type PermissionsProvider
- type PermissionsSnapshot
- type Server
- func (srv *Server) CheckLegacyMembership(ctx *router.Context) error
- func (srv *Server) GetPrincipalPermissions(ctx context.Context, request *rpcpb.GetPrincipalPermissionsRequest) (*rpcpb.PrincipalPermissions, error)
- func (srv *Server) GetSnapshot(ctx context.Context, request *rpcpb.GetSnapshotRequest) (*rpcpb.Snapshot, error)
- func (srv *Server) HandleLegacyAuthDBServing(ctx *router.Context) error
- func (srv *Server) RefreshPeriodically(ctx context.Context)
- func (srv *Server) WarmUp(ctx context.Context)
- type SnapshotJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachingPermissionsProvider ¶
type CachingPermissionsProvider struct {
// contains filtered or unexported fields
}
func (*CachingPermissionsProvider) GetAllPermissions ¶
func (cgp *CachingPermissionsProvider) GetAllPermissions(ctx context.Context) (map[string][]*rpcpb.RealmPermissions, error)
GetAllPermissions gets realm and analyzes the principal permissions mapping. The result may be stale.
func (*CachingPermissionsProvider) RefreshPeriodically ¶
func (cgp *CachingPermissionsProvider) RefreshPeriodically(ctx context.Context)
RefreshPeriodically runs a loop that periodically refreshes the cached copy of Permissions snapshot.
type PermissionsProvider ¶
type PermissionsProvider interface { GetAllPermissions(ctx context.Context) (map[string][]*rpcpb.RealmPermissions, error) RefreshPeriodically(ctx context.Context) }
PermissionsProvider is the interface to get all permissions entities.
type PermissionsSnapshot ¶
type PermissionsSnapshot struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct { rpcpb.UnimplementedAuthDBServer // contains filtered or unexported fields }
Server implements AuthDB server.
func (*Server) CheckLegacyMembership ¶
CheckLegacyMembership serves the legacy REST API GET request to check whether a given identity is a member of any of the given groups.
Example query:
"identity=user:someone@example.com&groups=group-a&groups=group-b"
Example response:
{ "is_member": true }
func (*Server) GetPrincipalPermissions ¶
func (srv *Server) GetPrincipalPermissions(ctx context.Context, request *rpcpb.GetPrincipalPermissionsRequest) (*rpcpb.PrincipalPermissions, error)
GetPrincipalPermissions implements the corresponding RPC method.
func (*Server) GetSnapshot ¶
func (srv *Server) GetSnapshot(ctx context.Context, request *rpcpb.GetSnapshotRequest) (*rpcpb.Snapshot, error)
GetSnapshot implements the corresponding RPC method.
func (*Server) HandleLegacyAuthDBServing ¶
HandleLegacyAuthDBServing handles the AuthDBSnapshot serving for legacy services. Writes the AuthDBSnapshot JSON to the router.Writer.
func (*Server) RefreshPeriodically ¶
RefreshPeriodically wraps the groups provider's refresh method.