Documentation ¶
Index ¶
- func CheckOrgRequirements(uc biz.CASBackendReader) middleware.Middleware
- func CheckUserInAllowList(allowList *conf.Auth_AllowList) middleware.Middleware
- func CurrentAuthzSubject(ctx context.Context) string
- func GetRawToken(ctx context.Context) (string, error)
- func Prometheus() middleware.Middleware
- func WithAttestationContextFromAPIToken(apiTokenUC *biz.APITokenUseCase, orgUC *biz.OrganizationUseCase, ...) middleware.Middleware
- func WithAttestationContextFromRobotAccount(robotAccountUseCase *biz.RobotAccountUseCase, ...) middleware.Middleware
- func WithAuthzSubject(ctx context.Context, subject string) context.Context
- func WithCurrentAPIToken(ctx context.Context, token *APIToken) context.Context
- func WithCurrentAPITokenAndOrgMiddleware(apiTokenUC *biz.APITokenUseCase, orgUC *biz.OrganizationUseCase, ...) middleware.Middleware
- func WithCurrentOrg(ctx context.Context, org *Org) context.Context
- func WithCurrentOrganizationMiddleware(userUseCase biz.UserOrgFinder, logger *log.Helper) middleware.Middleware
- func WithCurrentUser(ctx context.Context, user *User) context.Context
- func WithCurrentUserMiddleware(userUseCase biz.UserOrgFinder, logger *log.Helper) middleware.Middleware
- type APIToken
- type Org
- type RobotAccount
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckOrgRequirements ¶
func CheckOrgRequirements(uc biz.CASBackendReader) middleware.Middleware
func CheckUserInAllowList ¶
func CheckUserInAllowList(allowList *conf.Auth_AllowList) middleware.Middleware
Middleware that checks that the user is defined in the allow list
func CurrentAuthzSubject ¶ added in v0.75.0
func GetRawToken ¶ added in v0.96.0
GetRawToken takes whatever Bearer token is in the request
func Prometheus ¶ added in v0.127.0
func Prometheus() middleware.Middleware
This package contains a set of wrappers that take grpc.UnaryInterceptors and translate them into Kratos middlewares. The reason for having these kind of wrappers is so we can sort them in the context of the rest of middlewares. Otherwise, plain grpc interceptors will be added after the chain of middlewares https://github.com/go-kratos/kratos/blob/f8b97f675b32dfad02edae12d83053c720720b5b/transport/grpc/server.go#L166
func WithAttestationContextFromAPIToken ¶ added in v0.87.0
func WithAttestationContextFromAPIToken(apiTokenUC *biz.APITokenUseCase, orgUC *biz.OrganizationUseCase, logger *log.Helper) middleware.Middleware
WithAttestationContextFromAPIToken injects the API-Token, organization + robot account to the context
func WithAttestationContextFromRobotAccount ¶ added in v0.87.0
func WithAttestationContextFromRobotAccount(robotAccountUseCase *biz.RobotAccountUseCase, orgUseCase *biz.OrganizationUseCase, logger *log.Helper) middleware.Middleware
WithAttestationContextFromRobotAccount Middleware that injects the current user to the context
func WithAuthzSubject ¶ added in v0.75.0
Store the authorization subject
func WithCurrentAPIToken ¶ added in v0.55.0
func WithCurrentAPITokenAndOrgMiddleware ¶ added in v0.55.0
func WithCurrentAPITokenAndOrgMiddleware(apiTokenUC *biz.APITokenUseCase, orgUC *biz.OrganizationUseCase, logger *log.Helper) middleware.Middleware
Middleware that injects the API-Token + organization to the context
func WithCurrentOrg ¶ added in v0.55.0
func WithCurrentOrganizationMiddleware ¶ added in v0.92.0
func WithCurrentOrganizationMiddleware(userUseCase biz.UserOrgFinder, logger *log.Helper) middleware.Middleware
func WithCurrentUser ¶ added in v0.55.0
func WithCurrentUserMiddleware ¶ added in v0.92.0
func WithCurrentUserMiddleware(userUseCase biz.UserOrgFinder, logger *log.Helper) middleware.Middleware
Middleware that injects the current user + organization to the context
Types ¶
type APIToken ¶ added in v0.55.0
func CurrentAPIToken ¶ added in v0.55.0
type Org ¶
func CurrentOrg ¶
type RobotAccount ¶
type RobotAccount struct {
ID, WorkflowID, OrgID, ProviderKey string
}
func CurrentRobotAccount ¶
func CurrentRobotAccount(ctx context.Context) *RobotAccount