Help us shape the future of Go! Take the 2026 Go Developer Survey

authorization

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGroupNotFound           = errors.New("group not found")
	ErrAppAlreadyExistsInGroup = errors.New("app already exists in group")
	ErrAppDoesNotExistInGroup  = errors.New("app does not exist in group")
	ErrAppDoesNotExist         = errors.New("app does not exist")
	ErrInternalServerError     = errors.New("internal server error")
	ErrInvalidGroupID          = errors.New("invalid group id")
)

Functions

This section is empty.

Types

type AuthorizationDatabaseInterface

type AuthorizationDatabaseInterface interface {
	GetAllowedApps(context.Context, string) ([]string, error)
	AddAllowedApp(context.Context, string, string) error
	AddAllowedApps(context.Context, string, []string) error
	RemoveAllowedApp(context.Context, string, string) error
	RemoveAllowedApps(context.Context, string) ([]string, error)

	AddAllowedGroupsForApp(context.Context, string, []string) error
	GetAllowedGroupsForApp(context.Context, string) ([]string, error)
	RemoveAllAllowedGroupsForApp(context.Context, string) ([]string, error)
}

type AuthorizerInterface

type AuthorizerInterface interface {
	AddAllowedAppToGroup(context.Context, string, string) error
	RemoveAllowedAppFromGroup(context.Context, string, string) error
	RemoveAllAllowedAppsFromGroup(context.Context, string) error

	RemoveAllAllowedGroupsForApp(context.Context, string) error
}

type GrpcServer

type GrpcServer struct {
	v0_authz.UnimplementedAppAuthorizationServiceServer
	// contains filtered or unexported fields
}

GrpcServer is the gRPC server for the authorization service.

func NewGrpcServer

NewGrpcServer creates a new gRPC server.

func (*GrpcServer) AddAllowedAppToGroup

AddAllowedAppToGroup handles the gRPC request to add an allowed app to a group.

func (*GrpcServer) GetAllowedAppsInGroup

GetAllowedAppsInGroup handles the gRPC request to get allowed apps in a group.

func (*GrpcServer) GetAllowedGroupsForApp

GetAllowedGroupsForApp handles the gRPC request to get allowed groups for an app.

func (*GrpcServer) RemoveAllowedAppFromGroup

RemoveAllowedAppFromGroup handles the gRPC request to remove an allowed app from a group.

func (*GrpcServer) RemoveAllowedAppsFromGroup

RemoveAllowedAppsFromGroup handles the gRPC request to remove all allowed apps from a group.

func (*GrpcServer) RemoveAllowedGroupsForApp

RemoveAllowedGroupsForApp handles the gRPC request to remove all allowed groups for an app.

type Service

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

func (*Service) AddAllowedAppToGroup

func (s *Service) AddAllowedAppToGroup(ctx context.Context, groupID string, app string) error

func (*Service) GetAllowedAppsInGroup

func (s *Service) GetAllowedAppsInGroup(ctx context.Context, groupID string) ([]string, error)

func (*Service) GetAllowedGroupsForApp

func (s *Service) GetAllowedGroupsForApp(ctx context.Context, app string) ([]string, error)

func (*Service) RemoveAllAllowedAppsFromGroup

func (s *Service) RemoveAllAllowedAppsFromGroup(ctx context.Context, groupID string) error

func (*Service) RemoveAllAllowedGroupsForApp

func (s *Service) RemoveAllAllowedGroupsForApp(ctx context.Context, app string) error

func (*Service) RemoveAllowedAppFromGroup

func (s *Service) RemoveAllowedAppFromGroup(ctx context.Context, groupID string, app string) error

type ServiceInterface

type ServiceInterface interface {
	GetAllowedAppsInGroup(context.Context, string) ([]string, error)
	AddAllowedAppToGroup(context.Context, string, string) error
	RemoveAllAllowedAppsFromGroup(context.Context, string) error
	RemoveAllowedAppFromGroup(context.Context, string, string) error

	GetAllowedGroupsForApp(context.Context, string) ([]string, error)
	RemoveAllAllowedGroupsForApp(context.Context, string) error
}

Jump to

Keyboard shortcuts

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