controller

package
v0.0.0-...-284eadf Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2017 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Commit current build commit set by build script
	Commit = "0"
	// BuildTime set by build script in ISO 8601 (UTC) format: YYYY-MM-DDThh:mm:ssTZD (see https://www.w3.org/TR/NOTE-datetime for details)
	BuildTime = "0"
	// StartTime in ISO 8601 (UTC) format
	StartTime = time.Now().UTC().Format("2006-01-02T15:04:05Z")
)

Functions

func ConvertToAppUser

func ConvertToAppUser(request *goa.RequestData, user *account.User, identity *account.Identity) *app.User

ConvertToAppUser converts a complete Identity object into REST representation

func ConvertUserSimple

func ConvertUserSimple(request *goa.RequestData, identityID interface{}) *app.GenericData

ConvertUserSimple converts a simple Identity ID into a Generic Reletionship

func ConvertUsersSimple

func ConvertUsersSimple(request *goa.RequestData, identityIDs []interface{}) []*app.GenericData

ConvertUsersSimple converts a array of simple Identity IDs into a Generic Reletionship List

func GenerateUserToken

func GenerateUserToken(ctx context.Context, tokenEndpoint string, configuration LoginConfiguration, username string, userSecret string) (*app.AuthToken, error)

GenerateUserToken obtains the access token from Keycloak for the user

func LoadKeyCloakIdentities

func LoadKeyCloakIdentities(appl application.Application, users []account.User) ([]account.User, []account.Identity, error)

LoadKeyCloakIdentities loads keycloak identities for the users and returns the valid users along with their KC identities (if a user is missing his/her KC identity, he/she is filtered out of the result array)

Types

type CollaboratorsController

type CollaboratorsController struct {
	*goa.Controller
	// contains filtered or unexported fields
}

CollaboratorsController implements the collaborators resource.

func NewCollaboratorsController

func NewCollaboratorsController(service *goa.Service, db application.DB, config collaboratorsConfiguration, policyManager auth.AuthzPolicyManager) *CollaboratorsController

NewCollaboratorsController creates a collaborators controller.

func (*CollaboratorsController) Add

Add user's identity to the list of space collaborators.

func (*CollaboratorsController) AddMany

AddMany adds user's identities to the list of space collaborators.

func (*CollaboratorsController) List

List collaborators for the given space ID.

func (*CollaboratorsController) Remove

Remove user from the list of space collaborators.

func (*CollaboratorsController) RemoveMany

RemoveMany removes users from the list of space collaborators.

type LinkController

type LinkController struct {
	*goa.Controller
	Auth          login.KeycloakOAuthService
	TokenManager  token.Manager
	Configuration LoginConfiguration
}

LinkController implements the link resource.

func NewLinkController

func NewLinkController(service *goa.Service, auth *login.KeycloakOAuthProvider, tokenManager token.Manager, configuration LoginConfiguration) *LinkController

NewLinkController creates a link controller.

func (*LinkController) Callback

func (c *LinkController) Callback(ctx *app.CallbackLinkContext) error

Callback redirects to original referel when Identity Provider account are linked to the user account

func (c *LinkController) Link(ctx *app.LinkLinkContext) error

Link links identity provider(s) to the user's account

func (*LinkController) Session

func (c *LinkController) Session(ctx *app.SessionLinkContext) error

Session links identity provider(s) to the user's account

type LoginConfiguration

type LoginConfiguration interface {
	GetKeycloakEndpointAuth(*goa.RequestData) (string, error)
	GetKeycloakEndpointToken(*goa.RequestData) (string, error)
	GetKeycloakAccountEndpoint(req *goa.RequestData) (string, error)
	GetKeycloakEndpointBroker(*goa.RequestData) (string, error)
	GetKeycloakEndpointEntitlement(*goa.RequestData) (string, error)
	GetKeycloakClientID() string
	GetKeycloakSecret() string
	IsPostgresDeveloperModeEnabled() bool
	GetKeycloakTestUserName() string
	GetKeycloakTestUserSecret() string
	GetKeycloakTestUser2Name() string
	GetKeycloakTestUser2Secret() string
	GetValidRedirectURLs() string
	GetHeaderMaxLength() int64
	GetNotApprovedRedirect() string
	GetWITURL(*goa.RequestData) (string, error)
}

type LoginController

type LoginController struct {
	*goa.Controller
	Auth          login.KeycloakOAuthService
	TokenManager  token.Manager
	Configuration LoginConfiguration
}

LoginController implements the login resource.

func NewLoginController

func NewLoginController(service *goa.Service, auth *login.KeycloakOAuthProvider, tokenManager token.Manager, configuration LoginConfiguration) *LoginController

NewLoginController creates a login controller.

func (*LoginController) Login

func (c *LoginController) Login(ctx *app.LoginLoginContext) error

Login runs the login action.

type LogoutController

type LogoutController struct {
	*goa.Controller
	// contains filtered or unexported fields
}

LogoutController implements the logout resource.

func NewLogoutController

func NewLogoutController(service *goa.Service, logoutService *login.KeycloakLogoutService, configuration logoutConfiguration) *LogoutController

NewLogoutController creates a logout controller.

func (*LogoutController) Logout

Logout runs the logout action.

type ResourceController

type ResourceController struct {
	*goa.Controller
}

ResourceController implements the resource resource.

func NewResourceController

func NewResourceController(service *goa.Service) *ResourceController

NewResourceController creates a resource controller.

func (*ResourceController) Delete

Delete runs the delete action.

func (*ResourceController) Read

Read runs the read action.

func (*ResourceController) Register

Register runs the register action.

func (*ResourceController) Update

Update runs the update action.

type SearchController

type SearchController struct {
	*goa.Controller
	// contains filtered or unexported fields
}

SearchController implements the search resource.

func NewSearchController

func NewSearchController(service *goa.Service, db application.DB, configuration searchConfiguration) *SearchController

NewSearchController creates a search controller.

func (*SearchController) Users

Users runs the user search action.

type SpaceConfiguration

type SpaceConfiguration interface {
	GetKeycloakEndpointAuthzResourceset(*goa.RequestData) (string, error)
	GetKeycloakEndpointToken(*goa.RequestData) (string, error)
	GetKeycloakEndpointClients(*goa.RequestData) (string, error)
	GetKeycloakEndpointAdmin(*goa.RequestData) (string, error)
	GetKeycloakClientID() string
	GetKeycloakSecret() string
}

SpaceConfiguration represents space configuratoin

type SpaceController

type SpaceController struct {
	*goa.Controller
	// contains filtered or unexported fields
}

SpaceController implements the space resource.

func NewSpaceController

func NewSpaceController(service *goa.Service, db application.DB, config SpaceConfiguration, resourceManager auth.AuthzResourceManager) *SpaceController

NewSpaceController creates a space controller.

func (*SpaceController) Create

func (c *SpaceController) Create(ctx *app.CreateSpaceContext) error

Create runs the create action.

func (*SpaceController) Delete

func (c *SpaceController) Delete(ctx *app.DeleteSpaceContext) error

Delete runs the delete action.

type StatusController

type StatusController struct {
	*goa.Controller
	// contains filtered or unexported fields
}

StatusController implements the status resource.

func NewStatusController

func NewStatusController(service *goa.Service, db *gorm.DB) *StatusController

NewStatusController creates a status controller.

func (*StatusController) Show

Show runs the show action.

type TokenController

type TokenController struct {
	*goa.Controller
	Auth          login.KeycloakOAuthService
	TokenManager  token.Manager
	Configuration LoginConfiguration
	// contains filtered or unexported fields
}

TokenController implements the login resource.

func NewTokenController

func NewTokenController(service *goa.Service, auth *login.KeycloakOAuthProvider, tokenManager token.Manager, configuration LoginConfiguration, identityRepository account.IdentityRepository) *TokenController

NewTokenController creates a token controller.

func (*TokenController) Generate

func (c *TokenController) Generate(ctx *app.GenerateTokenContext) error

Generate obtain the access token from Keycloak for the test user

func (*TokenController) Keys

func (c *TokenController) Keys(ctx *app.KeysTokenContext) error

Keys returns public keys which should be used to verify tokens

func (*TokenController) Refresh

func (c *TokenController) Refresh(ctx *app.RefreshTokenContext) error

Refresh obtains a new access token using the refresh token.

type UserController

type UserController struct {
	*goa.Controller
	// contains filtered or unexported fields
}

UserController implements the user resource.

func NewUserController

func NewUserController(service *goa.Service, db application.DB, tokenManager token.Manager, config UserControllerConfiguration) *UserController

NewUserController creates a user controller.

func (*UserController) Show

func (c *UserController) Show(ctx *app.ShowUserContext) error

Show returns the authorized user based on the provided Token

type UserControllerConfiguration

type UserControllerConfiguration interface {
	GetCacheControlUser() string
}

UserControllerConfiguration the Configuration for the UserController

type UsersController

type UsersController struct {
	*goa.Controller

	RemoteWITService remoteservice.RemoteWITService
	// contains filtered or unexported fields
}

UsersController implements the users resource.

func NewUsersController

func NewUsersController(service *goa.Service, db application.DB, config UsersControllerConfiguration, userProfileService login.UserProfileService) *UsersController

NewUsersController creates a users controller.

func (*UsersController) List

func (c *UsersController) List(ctx *app.ListUsersContext) error

List runs the list action.

func (*UsersController) Show

func (c *UsersController) Show(ctx *app.ShowUsersContext) error

Show runs the show action.

func (*UsersController) Update

func (c *UsersController) Update(ctx *app.UpdateUsersContext) error

Update updates the authorized user based on the provided Token

type UsersControllerConfiguration

type UsersControllerConfiguration interface {
	GetCacheControlUsers() string
	GetCacheControlUser() string
	GetKeycloakAccountEndpoint(*goa.RequestData) (string, error)
	GetWITURL(*goa.RequestData) (string, error)
}

UsersControllerConfiguration the Configuration for the UsersController

Jump to

Keyboard shortcuts

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