api

package
v0.0.0-...-41ba12c Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	CheckAuthority(ctx context.Context, userID, organizationID string, permission model.Permission) error
	CreateRole(ctx context.Context, role model.Role) error
	UpdateRole(ctx context.Context, role model.Role) error
	GetRole(ctx context.Context, id string) (*model.Role, error)
	DeleteRole(ctx context.Context, id string) error
	AssignRole(ctx context.Context, userID, roleID, organizationID string) error
	RevokeRole(ctx context.Context, userID, roleID string) error
}

type Server

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

func New

func New(app Application) *Server

func (*Server) AuthorizeAction

func (s *Server) AuthorizeAction(ctx context.Context, action *auth.Action) (*empty.Empty, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) CreateRole

func (s *Server) CreateRole(ctx context.Context, role *auth.Role) (*auth.Role, error)

func (*Server) CreateRoleBinding

func (s *Server) CreateRoleBinding(ctx context.Context, req *auth.CreateRoleBindingRequest) (*empty.Empty, error)

func (*Server) DeleteRole

func (s *Server) DeleteRole(ctx context.Context, request *auth.DeleteRoleRequest) (*empty.Empty, error)

func (*Server) DeleteRoleBinding

func (s *Server) DeleteRoleBinding(ctx context.Context, req *auth.DeleteRoleBindingRequest) (*empty.Empty, error)

func (*Server) GetRole

func (s *Server) GetRole(ctx context.Context, request *auth.GetRoleRequest) (*auth.Role, error)

func (*Server) Serve

func (s *Server) Serve(address string) error

func (*Server) UpdateRole

func (s *Server) UpdateRole(ctx context.Context, role *auth.Role) (*auth.Role, error)

Jump to

Keyboard shortcuts

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