authz

package
v0.0.0-...-ef83997 Latest Latest
Warning

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

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

Documentation

Overview

Package authz contains the code that authorizes space operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(ctx context.Context, spaceID string) (bool, error)

Authorize returns true and the corresponding Requesting Party Token if the current user is among the space collaborators

func InjectAuthzService

func InjectAuthzService(service AuthzService) goa.Middleware

InjectAuthzService is a middleware responsible for setting up AuthzService in the context for every request.

Types

type AuthzConfiguration

type AuthzConfiguration interface {
	GetKeycloakEndpointEntitlement(*http.Request) (string, error)
	IsAuthorizationEnabled() bool
}

AuthzConfiguration represents a Keycloak entitlement endpoint configuration

type AuthzService

type AuthzService interface {
	Authorize(ctx context.Context, entitlementEndpoint string, spaceID string) (bool, error)
	Configuration() AuthzConfiguration
}

AuthzService represents a space authorization service

type AuthzServiceManager

type AuthzServiceManager interface {
	AuthzService() AuthzService
	EntitlementEndpoint() string
}

AuthzServiceManager represents a space autharizarion service

type KeycloakAuthzService

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

KeycloakAuthzService implements AuthzService interface

func NewAuthzService

func NewAuthzService(config AuthzConfiguration) *KeycloakAuthzService

NewAuthzService constructs a new KeycloakAuthzService

func (*KeycloakAuthzService) Authorize

func (s *KeycloakAuthzService) Authorize(ctx context.Context, entitlementEndpoint string, spaceID string) (bool, error)

Authorize returns true and the corresponding Requesting Party Token if the current user is among the space collaborators

func (*KeycloakAuthzService) Configuration

func (s *KeycloakAuthzService) Configuration() AuthzConfiguration

Configuration returns authz service configuration

type KeycloakAuthzServiceManager

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

KeycloakAuthzServiceManager is a keyaloak implementation of a space autharizarion service

func (*KeycloakAuthzServiceManager) AuthzService

func (m *KeycloakAuthzServiceManager) AuthzService() AuthzService

AuthzService returns a space autharizarion service

func (*KeycloakAuthzServiceManager) EntitlementEndpoint

func (m *KeycloakAuthzServiceManager) EntitlementEndpoint() string

EntitlementEndpoint returns a keycloak entitlement endpoint URL

Jump to

Keyboard shortcuts

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