controller

package
v0.0.0-...-42225ac Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: Apache-2.0 Imports: 27 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 LoginController

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

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) Authorize

func (c *LoginController) Authorize(ctx *app.AuthorizeLoginContext) error

Authorize runs the authorize action.

func (*LoginController) Generate

func (c *LoginController) Generate(ctx *app.GenerateLoginContext) error

Generate obtain the access token from Keycloak for the test user

func (c *LoginController) Link(ctx *app.LinkLoginContext) error

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

func (*LoginController) Linkcallback

func (c *LoginController) Linkcallback(ctx *app.LinkcallbackLoginContext) error

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

func (*LoginController) Linksession

func (c *LoginController) Linksession(ctx *app.LinksessionLoginContext) error

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

func (*LoginController) Refresh

func (c *LoginController) Refresh(ctx *app.RefreshLoginContext) error

Refresh obtain a new access token using the refresh token.

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 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 UserController

type UserController struct {
	*goa.Controller

	InitTenant func(context.Context) error
	// 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 UserServiceController

type UserServiceController struct {
	*goa.Controller
	UpdateTenant func(context.Context) error
}

UserServiceController implements the UserService resource.

func NewUserServiceController

func NewUserServiceController(service *goa.Service) *UserServiceController

NewUserServiceController creates a UserService controller.

func (*UserServiceController) Update

Update runs the update action.

type UsersController

type UsersController struct {
	*goa.Controller
	// 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
	GetKeycloakAccountEndpoint(*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