Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToAppUser(request *goa.RequestData, user *accountrepo.User, ...) *app.User
- func ConvertUserSimple(request *goa.RequestData, identityID interface{}) *app.GenericData
- func ConvertUsersSimple(request *goa.RequestData, identityIDs []interface{}) []*app.GenericData
- type AuthorizeController
- type AuthorizeControllerConfiguration
- type ClustersController
- type CollaboratorsController
- func (c *CollaboratorsController) Add(ctx *app.AddCollaboratorsContext) error
- func (c *CollaboratorsController) AddMany(ctx *app.AddManyCollaboratorsContext) error
- func (c *CollaboratorsController) List(ctx *app.ListCollaboratorsContext) error
- func (c *CollaboratorsController) Remove(ctx *app.RemoveCollaboratorsContext) error
- func (c *CollaboratorsController) RemoveMany(ctx *app.RemoveManyCollaboratorsContext) error
- type DBChecker
- type GormDBChecker
- type InvitationController
- type InvitationControllerConfiguration
- type LoginController
- type LogoutContext
- type LogoutController
- type NamedusersController
- type OpenidConfigurationController
- type OrganizationController
- type ResourceController
- type ResourceRolesController
- func (c *ResourceRolesController) AssignRole(ctx *app.AssignRoleResourceRolesContext) error
- func (c *ResourceRolesController) HasScope(ctx *app.HasScopeResourceRolesContext) error
- func (c *ResourceRolesController) ListAssigned(ctx *app.ListAssignedResourceRolesContext) error
- func (c *ResourceRolesController) ListAssignedByRoleName(ctx *app.ListAssignedByRoleNameResourceRolesContext) error
- type RolesController
- type SearchController
- type SpaceController
- type StatusController
- type TeamController
- type TokenController
- func (c *TokenController) Audit(ctx *app.AuditTokenContext) error
- func (c *TokenController) Delete(ctx *app.DeleteTokenContext) error
- func (c *TokenController) Exchange(ctx *app.ExchangeTokenContext) error
- func (c *TokenController) Keys(ctx *app.KeysTokenContext) error
- func (c *TokenController) Link(ctx *app.LinkTokenContext) error
- func (c *TokenController) LinkCallback(ctx *app.LinkCallbackTokenContext) error
- func (c *TokenController) Refresh(ctx *app.RefreshTokenContext) error
- func (c *TokenController) Retrieve(ctx *app.RetrieveTokenContext) error
- func (c *TokenController) Status(ctx *app.StatusTokenContext) error
- type TokenControllerConfiguration
- type UserController
- type UserControllerConfiguration
- type UserServiceController
- type UserinfoController
- type UsersController
- func (c *UsersController) Create(ctx *app.CreateUsersContext) error
- func (c *UsersController) List(ctx *app.ListUsersContext) error
- func (c *UsersController) ListTokens(ctx *app.ListTokensUsersContext) error
- func (c *UsersController) RevokeAllTokens(ctx *app.RevokeAllTokensUsersContext) error
- func (c *UsersController) SendEmailVerificationCode(ctx *app.SendEmailVerificationCodeUsersContext) error
- func (c *UsersController) Show(ctx *app.ShowUsersContext) error
- func (c *UsersController) Update(ctx *app.UpdateUsersContext) error
- func (c *UsersController) VerifyEmail(ctx *app.VerifyEmailUsersContext) error
- type UsersControllerConfiguration
Constants ¶
const ( DevUsername = "developer" DevEmail = "osio-developer@email.com" )
Variables ¶
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 *accountrepo.User, identity *accountrepo.Identity, isAuthenticated bool) *app.User
ConvertToAppUser converts a complete Identity object into REST representation if isAuthenticated is set to True, then the 'email' field is populated irrespective of whether 'emailPrivate' = true/false. if isAuthenticated is set of False, then the 'email' field is populated only if 'emailPrivate' = false.
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
Types ¶
type AuthorizeController ¶
type AuthorizeController struct { *goa.Controller // contains filtered or unexported fields }
AuthorizeController implements the authorize resource.
func NewAuthorizeController ¶
func NewAuthorizeController(service *goa.Service, app application.Application, config AuthorizeControllerConfiguration) *AuthorizeController
NewAuthorizeController returns a new AuthorizeController
func (*AuthorizeController) Authorize ¶
func (c *AuthorizeController) Authorize(ctx *app.AuthorizeAuthorizeContext) error
Authorize runs the authorize action of /api/authorize endpoint.
func (*AuthorizeController) Callback ¶
func (c *AuthorizeController) Callback(ctx *app.CallbackAuthorizeContext) error
Callback takes care of Authorize callback
type AuthorizeControllerConfiguration ¶
type AuthorizeControllerConfiguration interface {
GetPublicOAuthClientID() string
}
type ClustersController ¶
type ClustersController struct { *goa.Controller // contains filtered or unexported fields }
ClustersController implements the clusters resource.
func NewClustersController ¶
func NewClustersController(service *goa.Service, config clusterConfiguration) *ClustersController
NewClustersController creates a clusters controller.
func (*ClustersController) Show ¶
func (c *ClustersController) Show(ctx *app.ShowClustersContext) error
Show runs the list of available OSO clusters.
type CollaboratorsController ¶
type CollaboratorsController struct { *goa.Controller // contains filtered or unexported fields }
CollaboratorsController implements the collaborators resource.
func NewCollaboratorsController ¶
func NewCollaboratorsController(service *goa.Service, app application.Application, config collaboratorsConfiguration) *CollaboratorsController
NewCollaboratorsController creates a collaborators controller.
func (*CollaboratorsController) Add ¶
func (c *CollaboratorsController) Add(ctx *app.AddCollaboratorsContext) error
Add user's identity to the list of space collaborators.
func (*CollaboratorsController) AddMany ¶
func (c *CollaboratorsController) AddMany(ctx *app.AddManyCollaboratorsContext) error
AddMany adds user's identities to the list of space collaborators.
func (*CollaboratorsController) List ¶
func (c *CollaboratorsController) List(ctx *app.ListCollaboratorsContext) error
List collaborators for the given space ID.
func (*CollaboratorsController) Remove ¶
func (c *CollaboratorsController) Remove(ctx *app.RemoveCollaboratorsContext) error
Remove user from the list of space collaborators.
func (*CollaboratorsController) RemoveMany ¶
func (c *CollaboratorsController) RemoveMany(ctx *app.RemoveManyCollaboratorsContext) error
RemoveMany removes users from the list of space collaborators.
type DBChecker ¶
type DBChecker interface {
Ping() error
}
DBChecker is to be used to check if the DB is reachable
func NewGormDBChecker ¶
NewGormDBChecker constructs a new GormDBChecker
type GormDBChecker ¶
type GormDBChecker struct {
// contains filtered or unexported fields
}
GormDBChecker implements DB checker
func (*GormDBChecker) Ping ¶
func (c *GormDBChecker) Ping() error
type InvitationController ¶
type InvitationController struct { *goa.Controller // contains filtered or unexported fields }
InvitationController implements the invitation resource.
func NewInvitationController ¶
func NewInvitationController(service *goa.Service, app application.Application, configuration InvitationControllerConfiguration) *InvitationController
NewInvitationController creates a invitation controller.
func (*InvitationController) AcceptInvite ¶
func (c *InvitationController) AcceptInvite(ctx *app.AcceptInviteInvitationContext) error
func (*InvitationController) CreateInvite ¶
func (c *InvitationController) CreateInvite(ctx *app.CreateInviteInvitationContext) error
CreateInvite runs the create action.
func (*InvitationController) RescindInvite ¶
func (c *InvitationController) RescindInvite(ctx *app.RescindInviteInvitationContext) error
RescindInvite runs the revoke action.
type InvitationControllerConfiguration ¶
type InvitationControllerConfiguration interface {
GetInvitationAcceptedRedirectURL() string
}
InvitationControllerConfiguration the Configuration for the InvitationController
type LoginController ¶
type LoginController struct { *goa.Controller // contains filtered or unexported fields }
LoginController implements the login resource.
func NewLoginController ¶
func NewLoginController(service *goa.Service, app application.Application) *LoginController
NewLoginController creates a login controller.
func (*LoginController) Callback ¶
func (c *LoginController) Callback(ctx *app.CallbackLoginContext) error
Callback implemnents the `GET /api/login/callback` endpoint
func (*LoginController) Login ¶
func (c *LoginController) Login(ctx *app.LoginLoginContext) error
Login runs the login action.
type LogoutContext ¶
type LogoutContext interface { context.Context TemporaryRedirect() error InternalServerError(*app.JSONAPIErrors) error }
Common context interface for both logout endpoints
type LogoutController ¶
type LogoutController struct { *goa.Controller // contains filtered or unexported fields }
LogoutController implements the logout resource.
func NewLogoutController ¶
func NewLogoutController(service *goa.Service, app application.Application) *LogoutController
NewLogoutController creates a logout controller.
func (*LogoutController) Logout ¶
func (c *LogoutController) Logout(ctx *app.LogoutLogoutContext) error
Logout runs the logout action.
func (*LogoutController) Logoutv2 ¶
func (c *LogoutController) Logoutv2(ctx *app.Logoutv2LogoutContext) error
Logoutv2 is a secured logout endpoint that also invalidates all of the user's tokens
type NamedusersController ¶
type NamedusersController struct { *goa.Controller // contains filtered or unexported fields }
NamedusersController implements the namedusers resource.
func NewNamedusersController ¶
func NewNamedusersController(service *goa.Service, app application.Application, config UsersControllerConfiguration, tenantService appservice.TenantService) *NamedusersController
NewNamedusersController creates a namedusers controller.
func (*NamedusersController) Ban ¶
func (c *NamedusersController) Ban(ctx *app.BanNamedusersContext) error
Ban runs the "ban" action.
func (*NamedusersController) Deactivate ¶
func (c *NamedusersController) Deactivate(ctx *app.DeactivateNamedusersContext) error
Deactivate runs the deactivate action.
func (*NamedusersController) Deprovision ¶
func (c *NamedusersController) Deprovision(ctx *app.DeprovisionNamedusersContext) error
Deprovision runs the deprovision action. DEPRECATED: see `Ban`
type OpenidConfigurationController ¶
type OpenidConfigurationController struct {
*goa.Controller
}
OpenidConfigurationController implements the openid_configuration resource.
func NewOpenidConfigurationController ¶
func NewOpenidConfigurationController(service *goa.Service) *OpenidConfigurationController
NewOpenidConfigurationController creates a openid_configuration controller.
func (*OpenidConfigurationController) Show ¶
func (c *OpenidConfigurationController) Show(ctx *app.ShowOpenidConfigurationContext) error
Show runs the show action.
type OrganizationController ¶
type OrganizationController struct { *goa.Controller // contains filtered or unexported fields }
OrganizationController implements the organization resource.
func NewOrganizationController ¶
func NewOrganizationController(service *goa.Service, app application.Application) *OrganizationController
NewOrganizationController creates an organization controller.
func (*OrganizationController) Create ¶
func (c *OrganizationController) Create(ctx *app.CreateOrganizationContext) error
Create runs the create action.
func (*OrganizationController) List ¶
func (c *OrganizationController) List(ctx *app.ListOrganizationContext) error
List runs the list action.
type ResourceController ¶
type ResourceController struct { *goa.Controller TokenManager manager.TokenManager // contains filtered or unexported fields }
ResourceController implements the resource resource.
func NewResourceController ¶
func NewResourceController(service *goa.Service, app application.Application) *ResourceController
NewResourceController creates a resource controller.
func (*ResourceController) Delete ¶
func (c *ResourceController) Delete(ctx *app.DeleteResourceContext) error
Delete runs the delete action.
func (*ResourceController) Register ¶
func (c *ResourceController) Register(ctx *app.RegisterResourceContext) error
Register runs the register action.
func (*ResourceController) Scopes ¶
func (c *ResourceController) Scopes(ctx *app.ScopesResourceContext) error
Scopes runs the scopes action, which returns the available scopes for the specified resource
func (*ResourceController) Show ¶
func (c *ResourceController) Show(ctx *app.ShowResourceContext) error
Show runs the "Show" action.
type ResourceRolesController ¶
type ResourceRolesController struct { *goa.Controller // contains filtered or unexported fields }
ResourceRolesController implements the resource_roles resource.
func NewResourceRolesController ¶
func NewResourceRolesController(service *goa.Service, app application.Application) *ResourceRolesController
NewResourceRolesController creates a resource_roles controller.
func (*ResourceRolesController) AssignRole ¶
func (c *ResourceRolesController) AssignRole(ctx *app.AssignRoleResourceRolesContext) error
AssignRole assigns a specific role for a resource, to one or more identities.
func (*ResourceRolesController) HasScope ¶
func (c *ResourceRolesController) HasScope(ctx *app.HasScopeResourceRolesContext) error
HasScope checks if the user has the given scope in the requested resource
func (*ResourceRolesController) ListAssigned ¶
func (c *ResourceRolesController) ListAssigned(ctx *app.ListAssignedResourceRolesContext) error
ListAssigned runs the list action.
func (*ResourceRolesController) ListAssignedByRoleName ¶
func (c *ResourceRolesController) ListAssignedByRoleName(ctx *app.ListAssignedByRoleNameResourceRolesContext) error
ListAssignedByRoleName runs the list action.
type RolesController ¶
type RolesController struct { *goa.Controller // contains filtered or unexported fields }
RolesController implements the roles resource.
func NewRolesController ¶
func NewRolesController(service *goa.Service, app application.Application) *RolesController
NewRolesController creates a roles controller.
func (*RolesController) List ¶
func (c *RolesController) List(ctx *app.ListRolesContext) error
List runs the list 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, app application.Application, configuration searchConfiguration) *SearchController
NewSearchController creates a search controller.
func (*SearchController) Users ¶
func (c *SearchController) Users(ctx *app.UsersSearchContext) error
Users runs the user search action.
type SpaceController ¶
type SpaceController struct { *goa.Controller // contains filtered or unexported fields }
SpaceController implements the space resource.
func NewSpaceController ¶
func NewSpaceController(service *goa.Service, app application.Application) *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.
func (*SpaceController) ListTeams ¶
func (c *SpaceController) ListTeams(ctx *app.ListTeamsSpaceContext) error
ListTeams runs the listTeams 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, dbChecker DBChecker, config statusConfiguration) *StatusController
NewStatusController creates a status controller.
func (*StatusController) Show ¶
func (c *StatusController) Show(ctx *app.ShowStatusContext) error
Show runs the show action.
type TeamController ¶
type TeamController struct { *goa.Controller // contains filtered or unexported fields }
TeamController implements the team resource.
func NewTeamController ¶
func NewTeamController(service *goa.Service, app application.Application) *TeamController
NewTeamController creates a team controller.
func (*TeamController) Create ¶
func (c *TeamController) Create(ctx *app.CreateTeamContext) error
Create runs the create action.
func (*TeamController) List ¶
func (c *TeamController) List(ctx *app.ListTeamContext) error
List runs the list action.
type TokenController ¶
type TokenController struct { *goa.Controller TokenManager manager.TokenManager Configuration TokenControllerConfiguration // contains filtered or unexported fields }
TokenController implements the login resource.
func NewTokenController ¶
func NewTokenController(service *goa.Service, app application.Application, tokenManager manager.TokenManager, configuration TokenControllerConfiguration) *TokenController
NewTokenController creates a token controller.
func (*TokenController) Audit ¶
func (c *TokenController) Audit(ctx *app.AuditTokenContext) error
func (*TokenController) Delete ¶
func (c *TokenController) Delete(ctx *app.DeleteTokenContext) error
Delete deletes the stored external provider token.
func (*TokenController) Exchange ¶
func (c *TokenController) Exchange(ctx *app.ExchangeTokenContext) error
Exchange provides OAuth2 and OpenID Connect token exchange. Currently only grant_type="client_credentials", "authorization_code", and "refresh_token" are supported.
grant_type="client_credentials" allows clients to authenticate using a service account ID and secret value. A service account token is returned as the result of successful exchange.
grant_type="authorization_code" is part of OAuth2 authorization flow.
grant_type="refresh_token" covers OpenID Connect token refresh flow.
func (*TokenController) Keys ¶
func (c *TokenController) Keys(ctx *app.KeysTokenContext) error
Keys returns public keys which should be used to verify tokens
func (*TokenController) Link ¶
func (c *TokenController) Link(ctx *app.LinkTokenContext) error
Link links the user account to an external resource provider such as GitHub
func (*TokenController) LinkCallback ¶
func (c *TokenController) LinkCallback(ctx *app.LinkCallbackTokenContext) error
LinkCallback is called by an external oauth2 resource provider such as GitHub as part of user's account linking flow
func (*TokenController) Refresh ¶
func (c *TokenController) Refresh(ctx *app.RefreshTokenContext) error
Refresh obtains a new access token using the refresh token.
func (*TokenController) Retrieve ¶
func (c *TokenController) Retrieve(ctx *app.RetrieveTokenContext) error
Retrieve fetches the stored external provider token.
func (*TokenController) Status ¶
func (c *TokenController) Status(ctx *app.StatusTokenContext) error
Status checks if the stored external provider token is available.
type TokenControllerConfiguration ¶
type TokenControllerConfiguration interface { provider.IdentityProviderConfiguration IsPostgresDeveloperModeEnabled() bool GetServiceAccounts() map[string]configuration.ServiceAccount GetPublicOAuthClientID() string }
type UserController ¶
type UserController struct { *goa.Controller // contains filtered or unexported fields }
UserController implements the user resource.
func NewUserController ¶
func NewUserController(service *goa.Service, app application.Application, config UserControllerConfiguration, tokenManager manager.TokenManager, tenantService appservice.TenantService) *UserController
NewUserController creates a user controller.
func (*UserController) ListResources ¶
func (c *UserController) ListResources(ctx *app.ListResourcesUserContext) error
ListResources returns a list of resources in which the current user has a role
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 // contains filtered or unexported fields }
UserServiceController implements the UserService resource.
func NewUserServiceController ¶
func NewUserServiceController(service *goa.Service, app application.Application) *UserServiceController
NewUserServiceController creates a UserService controller.
func (*UserServiceController) Show ¶
func (c *UserServiceController) Show(ctx *app.ShowUserServiceContext) error
Show runs the show action.
type UserinfoController ¶
type UserinfoController struct { *goa.Controller // contains filtered or unexported fields }
UserinfoController implements the userinfo resource.
func NewUserinfoController ¶
func NewUserinfoController(service *goa.Service, app application.Application, tokenManager manager.TokenManager) *UserinfoController
NewUserinfoController creates a userinfo controller.
func (*UserinfoController) Show ¶
func (c *UserinfoController) Show(ctx *app.ShowUserinfoContext) error
Show runs the show action, used in the OAuth/OpenID connect authentication flow
type UsersController ¶
type UsersController struct { *goa.Controller EmailVerificationService service.EmailVerificationService // contains filtered or unexported fields }
UsersController implements the users resource.
func NewUsersController ¶
func NewUsersController(service *goa.Service, app application.Application, config UsersControllerConfiguration) *UsersController
NewUsersController creates a users controller.
func (*UsersController) Create ¶
func (c *UsersController) Create(ctx *app.CreateUsersContext) error
Create creates a user when requested using a service account token
func (*UsersController) List ¶
func (c *UsersController) List(ctx *app.ListUsersContext) error
List runs the list action.
func (*UsersController) ListTokens ¶
func (c *UsersController) ListTokens(ctx *app.ListTokensUsersContext) error
ListTokens lists all of the tokens for the specified identity. This endpoint may only be invoked via the admin console service account
func (*UsersController) RevokeAllTokens ¶
func (c *UsersController) RevokeAllTokens(ctx *app.RevokeAllTokensUsersContext) error
func (*UsersController) SendEmailVerificationCode ¶
func (c *UsersController) SendEmailVerificationCode(ctx *app.SendEmailVerificationCodeUsersContext) error
SendEmailVerificationCode sends out a verification code to the user's email address
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
TODO move business logic to the user service Update updates the authorized user based on the provided Token
func (*UsersController) VerifyEmail ¶
func (c *UsersController) VerifyEmail(ctx *app.VerifyEmailUsersContext) error
VerifyEmail verifies a user's email when updated.
type UsersControllerConfiguration ¶
type UsersControllerConfiguration interface { GetCacheControlUsers() string GetCacheControlUser() string GetWITURL() (string, error) GetEmailVerifiedRedirectURL() string GetInternalUsersEmailAddressSuffix() string GetIgnoreEmailInProd() string GetOAuthProviderClientID() string GetOAuthProviderClientSecret() string }
UsersControllerConfiguration the Configuration for the UsersController