Version: v0.0.21 Latest Latest

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

Go to latest
Published: Sep 2, 2021 License: BSD-3-Clause Imports: 15 Imported by: 0



Package acl performs access control with ACL.



View Source
const (
	// new goma client client_id
	GomaClientClientID = ""


This section is empty.


This section is empty.


type ACL

type ACL struct {

ACL manages access control list.

func (*ACL) Update

func (a *ACL) Update(ctx context.Context) error

Update loads acl by Loader and sets it to Checker.

type AuthDB

type AuthDB interface {
	IsMember(ctx context.Context, email, group string) bool

AuthDB provides authentication database; user groups.

type Checker

type Checker struct {
	// contains filtered or unexported fields

Checker checks token.

func (*Checker) CheckToken

func (c *Checker) CheckToken(ctx context.Context, token *oauth2.Token, tokenInfo *auth.TokenInfo) (string, *oauth2.Token, error)

CheckToken checks token and returns group id and token used for backend API.

func (*Checker) FindGroup added in v0.0.18

func (c *Checker) FindGroup(ctx context.Context, tokenInfo *auth.TokenInfo) (*pb.Group, error)

FindGroup finds a group for tokenInfo.

func (*Checker) Set

func (c *Checker) Set(ctx context.Context, config *pb.ACL) error

Set sets config in the checker.

type DefaultAllowlist added in v0.0.14

type DefaultAllowlist struct{}

DefaultAllowlist is a loader to provide default allow list, which pass through EUC.

func (DefaultAllowlist) Load added in v0.0.14

func (DefaultAllowlist) Load(ctx context.Context) (*pb.ACL, error)

type FileLoader

type FileLoader struct {
	Filename string

FileLoader loads acl data from Filename.

func (FileLoader) Load

func (l FileLoader) Load(ctx context.Context) (*pb.ACL, error)

Loads loads acl stored as text proto in file.

type Loader

type Loader interface {
	Load(ctx context.Context) (*pb.ACL, error)

Loader loads acl data.

type StaticLoader

type StaticLoader struct {

StaticLoader loads static acl data.

func (StaticLoader) Load

func (l StaticLoader) Load(ctx context.Context) (*pb.ACL, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL