api

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: Apache-2.0 Imports: 25 Imported by: 10

Documentation

Index

Constants

View Source
const (
	ResourcePermission = "permission"

	ResourceUser = "user.user"
	ResourceRole = "user.role"
)
View Source
const ServiceName = "user"

Variables

Functions

func NewAccountGrpcClient

func NewAccountGrpcClient(conn GrpcConn) v13.AccountServer

func NewAuthGrpcClient

func NewAuthGrpcClient(conn GrpcConn) v12.AuthServer

func NewPermissionGrpcClient

func NewPermissionGrpcClient(conn GrpcConn) v15.PermissionServiceServer

func NewRefreshProvider

func NewRefreshProvider(srv v1.AuthServer, logger klog.Logger) session.RefreshTokenProvider

NewRefreshProvider return session.RefreshTokenProvider

Read session -> Call v1.AuthServer to exchange token -> invalid, sign out.

func NewRoleGrpcClient

func NewRoleGrpcClient(conn GrpcConn) v14.RoleServiceServer

func NewUserGrpcClient

func NewUserGrpcClient(conn GrpcConn) v1.UserServiceServer

Types

type GrpcConn

type GrpcConn grpc.ClientConnInterface

func NewGrpcConn

func NewGrpcConn(clientName api.ClientName, services *conf.Services, dis registry.Discovery, opt *api.Option, tokenMgr api.TokenManager, logger log.Logger, opts ...grpc2.ClientOption) (GrpcConn, func())

type HttpClient

type HttpClient *http.Client

type PermissionChecker

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

PermissionChecker impl authz.PermissionChecker and authz.PermissionManagementService from calling remote service

func NewRemotePermissionChecker

func NewRemotePermissionChecker(srv v1.PermissionServiceServer) *PermissionChecker

func (*PermissionChecker) AddGrant

func (r *PermissionChecker) AddGrant(ctx context.Context, resource authz.Resource, action authz.Action, subject authz.Subject, tenantID string, effect authz.Effect) error

func (*PermissionChecker) IsGrantTenant

func (r *PermissionChecker) IsGrantTenant(ctx context.Context, requirements authz.RequirementList, tenantID string, subjects ...authz.Subject) ([]authz.Effect, error)

func (*PermissionChecker) ListAcl

func (r *PermissionChecker) ListAcl(ctx context.Context, subjects ...authz.Subject) ([]authz.PermissionBean, error)

func (*PermissionChecker) RemoveGrant

func (r *PermissionChecker) RemoveGrant(ctx context.Context, subject authz.Subject, filter ...authz.FilterFunc) error

func (*PermissionChecker) UpdateGrant

func (r *PermissionChecker) UpdateGrant(ctx context.Context, subject authz.Subject, acl []authz.UpdateSubjectPermission) error

type UserTenantContrib

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

UserTenantContrib impl saas.TenantResolveContrib from calling remote or local service.

check whether user can present in a tenant

func NewUserTenantContrib

func NewUserTenantContrib(client v1.UserServiceServer) *UserTenantContrib

func (*UserTenantContrib) Name

func (u *UserTenantContrib) Name() string

func (*UserTenantContrib) Resolve

func (u *UserTenantContrib) Resolve(trCtx *saas.Context) error

Directories

Path Synopsis
account
v1
auth
v1
permission
v1
role
v1
user
v1

Jump to

Keyboard shortcuts

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