auth

package
v0.14.9 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright 2021 The Rode Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	RoleAnonymous            Role = "Anonymous"
	RoleEnforcer             Role = "Enforcer"
	RoleCollector            Role = "Collector"
	RoleApplicationDeveloper Role = "ApplicationDeveloper"
	RolePolicyDeveloper      Role = "PolicyDeveloper"
	RolePolicyAdministrator  Role = "PolicyAdministrator"
	RoleAdministrator        Role = "Administrator"

	PermissionCollectorRegister      Permission = "rode.collector.register"
	PermissionEvaluationResultRead   Permission = "rode.evaluationResult.read"
	PermissionOccurrenceRead         Permission = "rode.occurrence.read"
	PermissionOccurrenceWrite        Permission = "rode.occurrence.write"
	PermissionPolicyDelete           Permission = "rode.policy.delete"
	PermissionPolicyEvaluate         Permission = "rode.policy.evaluate"
	PermissionPolicyRead             Permission = "rode.policy.read"
	PermissionPolicyValidate         Permission = "rode.policy.validate"
	PermissionPolicyWrite            Permission = "rode.policy.write"
	PermissionPolicyAssignmentDelete Permission = "rode.policyAssignment.delete"
	PermissionPolicyAssignmentRead   Permission = "rode.policyAssignment.read"
	PermissionPolicyAssignmentWrite  Permission = "rode.policyAssignment.write"
	PermissionPolicyGroupDelete      Permission = "rode.policyGroup.delete"
	PermissionPolicyGroupRead        Permission = "rode.policyGroup.read"
	PermissionPolicyGroupWrite       Permission = "rode.policyGroup.write"
	PermissionResourceEvaluate       Permission = "rode.resource.evaluate"
	PermissionResourceRead           Permission = "rode.resource.read"
	PermissionNoteWrite              Permission = "rode.note.write"
)

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Authenticate(ctx context.Context) (context.Context, error)
}

func NewAuthenticator

func NewAuthenticator(authConfig *config.AuthConfig, logger *zap.Logger, registry RoleRegistry) Authenticator

type AuthorizationInterceptor added in v0.13.0

type AuthorizationInterceptor interface {
	Authorize(context.Context) (context.Context, error)
	LoadServicePermissions(serviceInfo map[string]grpc.ServiceInfo) error
}

func NewAuthorizationInterceptor added in v0.13.0

func NewAuthorizationInterceptor(authConfig *config.AuthConfig, logger *zap.Logger, registry RoleRegistry) AuthorizationInterceptor

type Permission added in v0.13.0

type Permission string

type Role added in v0.13.0

type Role string

type RoleRegistry added in v0.13.0

type RoleRegistry interface {
	GetRolePermissions(Role) []Permission
	GetRoleByName(string) Role
}

func NewRoleRegistry added in v0.13.0

func NewRoleRegistry() RoleRegistry

Jump to

Keyboard shortcuts

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