impl

package
v0.0.0-...-650f6e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package impl contains code shared by `frontend` and `backend` services.

Index

Constants

This section is empty.

Variables

View Source
var AuthorizeRPCAccess = rpcacl.Interceptor(rpcacl.Map{

	"/discovery.Discovery/*": rpcacl.All,

	"/auth.service.Accounts/GetSelf": rpcacl.All,

	"/auth.service.Groups/*": authdb.AuthServiceAccessGroup,

	"/auth.service.Groups/CreateGroup": model.AdminGroup,

	"/auth.service.Allowlists/*": authdb.AuthServiceAccessGroup,

	"/auth.service.AuthDB/*": authdb.AuthServiceAccessGroup,

	"/auth.service.ChangeLogs/*": authdb.AuthServiceAccessGroup,

	"/auth.internals.Internals/*": authdb.AuthServiceAccessGroup,

	"/config.Consumer/*": rpcacl.All,
})

AuthorizeRPCAccess is a gRPC server interceptor that checks the caller is in the group that grants access to the auth service API.

Functions

func Main

func Main(modules []module.Module, cb func(srv *server.Server) error)

Main launches a server with some default modules and configuration installed.

Types

type AuthDBProvider

type AuthDBProvider struct {
	// contains filtered or unexported fields
}

AuthDBProvider knows how to produce an up-to-date authdb.DB instance.

It caches it in memory, refetching it from Datastore when it detects the cached copy is stale.

func (*AuthDBProvider) GetAuthDB

func (a *AuthDBProvider) GetAuthDB(ctx context.Context) (db authdb.DB, err error)

GetAuthDB returns the latest authdb.DB instance to use for ACL checks.

Refetches it from the datastore if necessary.

func (*AuthDBProvider) RefreshPeriodically

func (a *AuthDBProvider) RefreshPeriodically(ctx context.Context)

RefreshPeriodically runs a loop that periodically refreshes the cached copy of AuthDB.

Directories

Path Synopsis
Package info facilitates adding global application info to a context.
Package info facilitates adding global application info to a context.
Package model contains datastore model definitions.
Package model contains datastore model definitions.
graph
Package graph contains groups graph definitions and operations.
Package graph contains groups graph definitions and operations.
servers
accounts
Package accounts contains Accounts server implementation.
Package accounts contains Accounts server implementation.
allowlists
Package allowlists contains Allowlists server implementation.
Package allowlists contains Allowlists server implementation.
authdb
Package authdb contains methods to work with authdb.
Package authdb contains methods to work with authdb.
changelogs
Package changelogs contains ChangeLogs server implementation.
Package changelogs contains ChangeLogs server implementation.
groups
Package groups contains Groups server implementation.
Package groups contains Groups server implementation.
imports
Package imports contains Imports endpoints implementation.
Package imports contains Imports endpoints implementation.
internals
Package internals contains Internals server implementation.
Package internals contains Internals server implementation.
oauth
Package oauth contains methods to work with oauth endpoint.
Package oauth contains methods to work with oauth endpoint.
util
zlib
Package zlib contains functions for zlib encoding and decoding.
Package zlib contains functions for zlib encoding and decoding.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL