id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
150,700
fabric8-services/fabric8-auth
wit/service/wit_service.go
CreateUser
func (s *witServiceImpl) CreateUser(ctx context.Context, identity *account.Identity, identityID string) error { createUserPayload := &witservice.CreateUserAsServiceAccountUsersPayload{ Data: &witservice.CreateUserData{ Attributes: &witservice.CreateIdentityDataAttributes{ Bio: &identity.User.Bio, ...
go
func (s *witServiceImpl) CreateUser(ctx context.Context, identity *account.Identity, identityID string) error { createUserPayload := &witservice.CreateUserAsServiceAccountUsersPayload{ Data: &witservice.CreateUserData{ Attributes: &witservice.CreateIdentityDataAttributes{ Bio: &identity.User.Bio, ...
[ "func", "(", "s", "*", "witServiceImpl", ")", "CreateUser", "(", "ctx", "context", ".", "Context", ",", "identity", "*", "account", ".", "Identity", ",", "identityID", "string", ")", "error", "{", "createUserPayload", ":=", "&", "witservice", ".", "CreateUse...
// CreateUser creates a new user in WIT
[ "CreateUser", "creates", "a", "new", "user", "in", "WIT" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/wit/service/wit_service.go#L83-L123
150,701
fabric8-services/fabric8-auth
wit/service/wit_service.go
DeleteUser
func (s *witServiceImpl) DeleteUser(ctx context.Context, username string) error { log.Info(ctx, map[string]interface{}{"username": username}, "deleting user on WIT service") // this endpoint is restricted to the `auth` Service Account remoteWITService, err := s.createClientWithContextSigner(ctx) if err != nil { r...
go
func (s *witServiceImpl) DeleteUser(ctx context.Context, username string) error { log.Info(ctx, map[string]interface{}{"username": username}, "deleting user on WIT service") // this endpoint is restricted to the `auth` Service Account remoteWITService, err := s.createClientWithContextSigner(ctx) if err != nil { r...
[ "func", "(", "s", "*", "witServiceImpl", ")", "DeleteUser", "(", "ctx", "context", ".", "Context", ",", "username", "string", ")", "error", "{", "log", ".", "Info", "(", "ctx", ",", "map", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ...
// DeleteUser deletes a user in WIT
[ "DeleteUser", "deletes", "a", "user", "in", "WIT" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/wit/service/wit_service.go#L126-L149
150,702
fabric8-services/fabric8-auth
wit/service/wit_service.go
GetSpace
func (s *witServiceImpl) GetSpace(ctx context.Context, spaceID string) (space *wit.Space, e error) { remoteWITService, err := s.createClientWithContextSigner(ctx) if err != nil { return nil, err } spaceIDUUID, err := uuid.FromString(spaceID) if err != nil { return nil, err } res, err := remoteWITService.Sh...
go
func (s *witServiceImpl) GetSpace(ctx context.Context, spaceID string) (space *wit.Space, e error) { remoteWITService, err := s.createClientWithContextSigner(ctx) if err != nil { return nil, err } spaceIDUUID, err := uuid.FromString(spaceID) if err != nil { return nil, err } res, err := remoteWITService.Sh...
[ "func", "(", "s", "*", "witServiceImpl", ")", "GetSpace", "(", "ctx", "context", ".", "Context", ",", "spaceID", "string", ")", "(", "space", "*", "wit", ".", "Space", ",", "e", "error", ")", "{", "remoteWITService", ",", "err", ":=", "s", ".", "crea...
// GetSpace talks to the WIT service to retrieve a space record for the specified spaceID, then returns space
[ "GetSpace", "talks", "to", "the", "WIT", "service", "to", "retrieve", "a", "space", "record", "for", "the", "specified", "spaceID", "then", "returns", "space" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/wit/service/wit_service.go#L152-L189
150,703
fabric8-services/fabric8-auth
che/service/che_service.go
NewCheService
func NewCheService(context servicecontext.ServiceContext, config Configuration) service.CheService { return &cheServiceImpl{ BaseService: base.NewBaseService(context), config: config, } }
go
func NewCheService(context servicecontext.ServiceContext, config Configuration) service.CheService { return &cheServiceImpl{ BaseService: base.NewBaseService(context), config: config, } }
[ "func", "NewCheService", "(", "context", "servicecontext", ".", "ServiceContext", ",", "config", "Configuration", ")", "service", ".", "CheService", "{", "return", "&", "cheServiceImpl", "{", "BaseService", ":", "base", ".", "NewBaseService", "(", "context", ")", ...
// NewCheService creates a new Che service.
[ "NewCheService", "creates", "a", "new", "Che", "service", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/che/service/che_service.go#L34-L39
150,704
fabric8-services/fabric8-auth
che/service/che_service.go
DeleteUser
func (s *cheServiceImpl) DeleteUser(ctx context.Context, identity repository.Identity) error { log.Info(ctx, map[string]interface{}{"identity_id": identity.ID.String()}, "deleting user on Che service") // this endpoint is restricted to the `auth` Service Account deleteUserAPIURL := fmt.Sprintf("%s/api/user/%s", s.co...
go
func (s *cheServiceImpl) DeleteUser(ctx context.Context, identity repository.Identity) error { log.Info(ctx, map[string]interface{}{"identity_id": identity.ID.String()}, "deleting user on Che service") // this endpoint is restricted to the `auth` Service Account deleteUserAPIURL := fmt.Sprintf("%s/api/user/%s", s.co...
[ "func", "(", "s", "*", "cheServiceImpl", ")", "DeleteUser", "(", "ctx", "context", ".", "Context", ",", "identity", "repository", ".", "Identity", ")", "error", "{", "log", ".", "Info", "(", "ctx", ",", "map", "[", "string", "]", "interface", "{", "}",...
// DeleteUser deletes a user in Che
[ "DeleteUser", "deletes", "a", "user", "in", "Che" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/che/service/che_service.go#L42-L96
150,705
fabric8-services/fabric8-auth
authorization/permission/service/permission_service.go
NewPermissionService
func NewPermissionService(context servicecontext.ServiceContext) service.PermissionService { return &permissionServiceImpl{base.NewBaseService(context)} }
go
func NewPermissionService(context servicecontext.ServiceContext) service.PermissionService { return &permissionServiceImpl{base.NewBaseService(context)} }
[ "func", "NewPermissionService", "(", "context", "servicecontext", ".", "ServiceContext", ")", "service", ".", "PermissionService", "{", "return", "&", "permissionServiceImpl", "{", "base", ".", "NewBaseService", "(", "context", ")", "}", "\n", "}" ]
// NewPermissionModelService creates a new service.
[ "NewPermissionModelService", "creates", "a", "new", "service", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/permission/service/permission_service.go#L21-L23
150,706
fabric8-services/fabric8-auth
authorization/permission/service/permission_service.go
RequireScope
func (s *permissionServiceImpl) RequireScope(ctx context.Context, identityID uuid.UUID, resourceID string, scopeName string) error { result, err := s.HasScope(ctx, identityID, resourceID, scopeName) if err != nil { return errors.NewInternalError(ctx, err) } if !result { return errors.NewForbiddenError(fmt.Spri...
go
func (s *permissionServiceImpl) RequireScope(ctx context.Context, identityID uuid.UUID, resourceID string, scopeName string) error { result, err := s.HasScope(ctx, identityID, resourceID, scopeName) if err != nil { return errors.NewInternalError(ctx, err) } if !result { return errors.NewForbiddenError(fmt.Spri...
[ "func", "(", "s", "*", "permissionServiceImpl", ")", "RequireScope", "(", "ctx", "context", ".", "Context", ",", "identityID", "uuid", ".", "UUID", ",", "resourceID", "string", ",", "scopeName", "string", ")", "error", "{", "result", ",", "err", ":=", "s",...
// RequireScope is the same as HasScope, except instead of returning a boolean value it will just return an error if the // identity does not have the specified scope for the resource
[ "RequireScope", "is", "the", "same", "as", "HasScope", "except", "instead", "of", "returning", "a", "boolean", "value", "it", "will", "just", "return", "an", "error", "if", "the", "identity", "does", "not", "have", "the", "specified", "scope", "for", "the", ...
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/permission/service/permission_service.go#L44-L55
150,707
fabric8-services/fabric8-auth
authorization/team/service/team_service.go
NewTeamService
func NewTeamService(context servicecontext.ServiceContext) service.TeamService { return &teamServiceImpl{base.NewBaseService(context)} }
go
func NewTeamService(context servicecontext.ServiceContext) service.TeamService { return &teamServiceImpl{base.NewBaseService(context)} }
[ "func", "NewTeamService", "(", "context", "servicecontext", ".", "ServiceContext", ")", "service", ".", "TeamService", "{", "return", "&", "teamServiceImpl", "{", "base", ".", "NewBaseService", "(", "context", ")", "}", "\n", "}" ]
// NewTeamService creates a new service.
[ "NewTeamService", "creates", "a", "new", "service", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/team/service/team_service.go#L26-L28
150,708
fabric8-services/fabric8-auth
authorization/team/service/team_service.go
ListTeamsInSpace
func (s *teamServiceImpl) ListTeamsInSpace(ctx context.Context, identityID uuid.UUID, spaceID string) ([]account.Identity, error) { // Confirm that the specified spaceID is valid space, err := s.Repositories().ResourceRepository().Load(ctx, spaceID) if err != nil { return nil, errors.NewBadParameterErrorFromString...
go
func (s *teamServiceImpl) ListTeamsInSpace(ctx context.Context, identityID uuid.UUID, spaceID string) ([]account.Identity, error) { // Confirm that the specified spaceID is valid space, err := s.Repositories().ResourceRepository().Load(ctx, spaceID) if err != nil { return nil, errors.NewBadParameterErrorFromString...
[ "func", "(", "s", "*", "teamServiceImpl", ")", "ListTeamsInSpace", "(", "ctx", "context", ".", "Context", ",", "identityID", "uuid", ".", "UUID", ",", "spaceID", "string", ")", "(", "[", "]", "account", ".", "Identity", ",", "error", ")", "{", "// Confir...
// Returns an array of all team identities within a space
[ "Returns", "an", "array", "of", "all", "team", "identities", "within", "a", "space" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/team/service/team_service.go#L120-L154
150,709
fabric8-services/fabric8-auth
authorization/team/service/team_service.go
ListTeamsForIdentity
func (s *teamServiceImpl) ListTeamsForIdentity(ctx context.Context, identityID uuid.UUID) ([]authorization.IdentityAssociation, error) { resourceType := authorization.IdentityResourceTypeTeam // first find the identity's memberships memberships, err := s.Repositories().Identities().FindIdentityMemberships(ctx, iden...
go
func (s *teamServiceImpl) ListTeamsForIdentity(ctx context.Context, identityID uuid.UUID) ([]authorization.IdentityAssociation, error) { resourceType := authorization.IdentityResourceTypeTeam // first find the identity's memberships memberships, err := s.Repositories().Identities().FindIdentityMemberships(ctx, iden...
[ "func", "(", "s", "*", "teamServiceImpl", ")", "ListTeamsForIdentity", "(", "ctx", "context", ".", "Context", ",", "identityID", "uuid", ".", "UUID", ")", "(", "[", "]", "authorization", ".", "IdentityAssociation", ",", "error", ")", "{", "resourceType", ":=...
// Returns an array of all teams in which the specified identity is a member or is assigned a role
[ "Returns", "an", "array", "of", "all", "teams", "in", "which", "the", "specified", "identity", "is", "a", "member", "or", "is", "assigned", "a", "role" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/team/service/team_service.go#L157-L175
150,710
fabric8-services/fabric8-auth
authorization/token/repository/external_provider_token.go
DeleteByIdentityID
func (m *GormExternalTokenRepository) DeleteByIdentityID(ctx context.Context, identityID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "ExternalToken", "deleteByIdentityID"}, time.Now()) result := m.db.Where("identity_id = ?", identityID).Delete(ExternalToken{IdentityID: identityID}) if result.Erro...
go
func (m *GormExternalTokenRepository) DeleteByIdentityID(ctx context.Context, identityID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "ExternalToken", "deleteByIdentityID"}, time.Now()) result := m.db.Where("identity_id = ?", identityID).Delete(ExternalToken{IdentityID: identityID}) if result.Erro...
[ "func", "(", "m", "*", "GormExternalTokenRepository", ")", "DeleteByIdentityID", "(", "ctx", "context", ".", "Context", ",", "identityID", "uuid", ".", "UUID", ")", "error", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", "{", "\"", "\""...
// DeleteByIdentityID removes all records associated with a given identity ID
[ "DeleteByIdentityID", "removes", "all", "records", "associated", "with", "a", "given", "identity", "ID" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/repository/external_provider_token.go#L168-L182
150,711
fabric8-services/fabric8-auth
authorization/token/repository/external_provider_token.go
LoadByProviderIDAndIdentityID
func (m *GormExternalTokenRepository) LoadByProviderIDAndIdentityID(ctx context.Context, providerID uuid.UUID, identityID uuid.UUID) ([]ExternalToken, error) { defer goa.MeasureSince([]string{"goa", "db", "ExternalToken", "LoadByProviderIDAndIdentityID"}, time.Now()) var externalProviderTokens []ExternalToken extern...
go
func (m *GormExternalTokenRepository) LoadByProviderIDAndIdentityID(ctx context.Context, providerID uuid.UUID, identityID uuid.UUID) ([]ExternalToken, error) { defer goa.MeasureSince([]string{"goa", "db", "ExternalToken", "LoadByProviderIDAndIdentityID"}, time.Now()) var externalProviderTokens []ExternalToken extern...
[ "func", "(", "m", "*", "GormExternalTokenRepository", ")", "LoadByProviderIDAndIdentityID", "(", "ctx", "context", ".", "Context", ",", "providerID", "uuid", ".", "UUID", ",", "identityID", "uuid", ".", "UUID", ")", "(", "[", "]", "ExternalToken", ",", "error"...
// LoadByProviderIDAndIdentityID loads tokens by IdentityID and ProviderID
[ "LoadByProviderIDAndIdentityID", "loads", "tokens", "by", "IdentityID", "and", "ProviderID" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/repository/external_provider_token.go#L201-L209
150,712
fabric8-services/fabric8-auth
authorization/token/repository/external_provider_token.go
ExternalTokenFilterByIdentityID
func ExternalTokenFilterByIdentityID(identityID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("identity_id = ?", identityID) } }
go
func ExternalTokenFilterByIdentityID(identityID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("identity_id = ?", identityID) } }
[ "func", "ExternalTokenFilterByIdentityID", "(", "identityID", "uuid", ".", "UUID", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "...
// ExternalTokenFilterByIdentityID is a gorm filter for a Belongs To relationship.
[ "ExternalTokenFilterByIdentityID", "is", "a", "gorm", "filter", "for", "a", "Belongs", "To", "relationship", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/repository/external_provider_token.go#L212-L216
150,713
fabric8-services/fabric8-auth
authorization/token/repository/external_provider_token.go
ExternalTokenFilterByProviderID
func ExternalTokenFilterByProviderID(providerID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("provider_id = ?", providerID) } }
go
func ExternalTokenFilterByProviderID(providerID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("provider_id = ?", providerID) } }
[ "func", "ExternalTokenFilterByProviderID", "(", "providerID", "uuid", ".", "UUID", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "...
// ExternalTokenFilterByProviderID is a gorm filter by 'external_provider_type'
[ "ExternalTokenFilterByProviderID", "is", "a", "gorm", "filter", "by", "external_provider_type" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/repository/external_provider_token.go#L219-L223
150,714
fabric8-services/fabric8-auth
authorization/token/repository/external_provider_token.go
ExternalTokenWithIdentity
func ExternalTokenWithIdentity() func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Preload("Identity") } }
go
func ExternalTokenWithIdentity() func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Preload("Identity") } }
[ "func", "ExternalTokenWithIdentity", "(", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "db", ".", "Preload", "("...
// ExternalTokenWithIdentity is a gorm filter for preloading the identity relationship.
[ "ExternalTokenWithIdentity", "is", "a", "gorm", "filter", "for", "preloading", "the", "identity", "relationship", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/repository/external_provider_token.go#L226-L230
150,715
fabric8-services/fabric8-auth
controller/token.go
NewTokenController
func NewTokenController(service *goa.Service, app application.Application, tokenManager manager.TokenManager, configuration TokenControllerConfiguration) *TokenController { return &TokenController{ Controller: service.NewController("token"), TokenManager: tokenManager, Configuration: configuration, app: ...
go
func NewTokenController(service *goa.Service, app application.Application, tokenManager manager.TokenManager, configuration TokenControllerConfiguration) *TokenController { return &TokenController{ Controller: service.NewController("token"), TokenManager: tokenManager, Configuration: configuration, app: ...
[ "func", "NewTokenController", "(", "service", "*", "goa", ".", "Service", ",", "app", "application", ".", "Application", ",", "tokenManager", "manager", ".", "TokenManager", ",", "configuration", "TokenControllerConfiguration", ")", "*", "TokenController", "{", "ret...
// NewTokenController creates a token controller.
[ "NewTokenController", "creates", "a", "token", "controller", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/token.go#L46-L54
150,716
fabric8-services/fabric8-auth
controller/token.go
Keys
func (c *TokenController) Keys(ctx *app.KeysTokenContext) error { var publicKeys token.JSONKeys if ctx.Format != nil && *ctx.Format == "pem" { publicKeys = c.TokenManager.PemKeys() } else { publicKeys = c.TokenManager.JSONWebKeys() } return ctx.OK(&app.PublicKeys{Keys: publicKeys.Keys}) }
go
func (c *TokenController) Keys(ctx *app.KeysTokenContext) error { var publicKeys token.JSONKeys if ctx.Format != nil && *ctx.Format == "pem" { publicKeys = c.TokenManager.PemKeys() } else { publicKeys = c.TokenManager.JSONWebKeys() } return ctx.OK(&app.PublicKeys{Keys: publicKeys.Keys}) }
[ "func", "(", "c", "*", "TokenController", ")", "Keys", "(", "ctx", "*", "app", ".", "KeysTokenContext", ")", "error", "{", "var", "publicKeys", "token", ".", "JSONKeys", "\n", "if", "ctx", ".", "Format", "!=", "nil", "&&", "*", "ctx", ".", "Format", ...
// Keys returns public keys which should be used to verify tokens
[ "Keys", "returns", "public", "keys", "which", "should", "be", "used", "to", "verify", "tokens" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/token.go#L57-L66
150,717
fabric8-services/fabric8-auth
controller/token.go
Refresh
func (c *TokenController) Refresh(ctx *app.RefreshTokenContext) error { // retrieve the access token if it exists (otherwise, a jwtrequest.ErrNoTokenInRequest is returned, but it can be ignored here) accessToken := goajwt.ContextJWT(ctx) refreshToken := ctx.Payload.RefreshToken if refreshToken == nil { return jso...
go
func (c *TokenController) Refresh(ctx *app.RefreshTokenContext) error { // retrieve the access token if it exists (otherwise, a jwtrequest.ErrNoTokenInRequest is returned, but it can be ignored here) accessToken := goajwt.ContextJWT(ctx) refreshToken := ctx.Payload.RefreshToken if refreshToken == nil { return jso...
[ "func", "(", "c", "*", "TokenController", ")", "Refresh", "(", "ctx", "*", "app", ".", "RefreshTokenContext", ")", "error", "{", "// retrieve the access token if it exists (otherwise, a jwtrequest.ErrNoTokenInRequest is returned, but it can be ignored here)", "accessToken", ":=",...
// Refresh obtains a new access token using the refresh token.
[ "Refresh", "obtains", "a", "new", "access", "token", "using", "the", "refresh", "token", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/token.go#L69-L89
150,718
fabric8-services/fabric8-auth
controller/token.go
Retrieve
func (c *TokenController) Retrieve(ctx *app.RetrieveTokenContext) error { appToken, errorResponse, err := c.app.TokenService().RetrieveExternalToken(ctx, ctx.For, ctx.RequestData, ctx.ForcePull) if errorResponse != nil { ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate") ctx.Respon...
go
func (c *TokenController) Retrieve(ctx *app.RetrieveTokenContext) error { appToken, errorResponse, err := c.app.TokenService().RetrieveExternalToken(ctx, ctx.For, ctx.RequestData, ctx.ForcePull) if errorResponse != nil { ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate") ctx.Respon...
[ "func", "(", "c", "*", "TokenController", ")", "Retrieve", "(", "ctx", "*", "app", ".", "RetrieveTokenContext", ")", "error", "{", "appToken", ",", "errorResponse", ",", "err", ":=", "c", ".", "app", ".", "TokenService", "(", ")", ".", "RetrieveExternalTok...
// Retrieve fetches the stored external provider token.
[ "Retrieve", "fetches", "the", "stored", "external", "provider", "token", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/token.go#L103-L116
150,719
fabric8-services/fabric8-auth
controller/token.go
Status
func (c *TokenController) Status(ctx *app.StatusTokenContext) error { appToken, errorResponse, err := c.app.TokenService().RetrieveExternalToken(ctx, ctx.For, ctx.RequestData, ctx.ForcePull) if errorResponse != nil { ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate") ctx.ResponseDa...
go
func (c *TokenController) Status(ctx *app.StatusTokenContext) error { appToken, errorResponse, err := c.app.TokenService().RetrieveExternalToken(ctx, ctx.For, ctx.RequestData, ctx.ForcePull) if errorResponse != nil { ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate") ctx.ResponseDa...
[ "func", "(", "c", "*", "TokenController", ")", "Status", "(", "ctx", "*", "app", ".", "StatusTokenContext", ")", "error", "{", "appToken", ",", "errorResponse", ",", "err", ":=", "c", ".", "app", ".", "TokenService", "(", ")", ".", "RetrieveExternalToken",...
// Status checks if the stored external provider token is available.
[ "Status", "checks", "if", "the", "stored", "external", "provider", "token", "is", "available", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/token.go#L119-L137
150,720
fabric8-services/fabric8-auth
controller/token.go
Delete
func (c *TokenController) Delete(ctx *app.DeleteTokenContext) error { currentIdentity, err := manager.ContextIdentity(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } if ctx.For == "" { return jsonapi.JSONErrorResponse(ctx, errors.NewBadParameterError("for", "").Expected("git or OpenShift resou...
go
func (c *TokenController) Delete(ctx *app.DeleteTokenContext) error { currentIdentity, err := manager.ContextIdentity(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } if ctx.For == "" { return jsonapi.JSONErrorResponse(ctx, errors.NewBadParameterError("for", "").Expected("git or OpenShift resou...
[ "func", "(", "c", "*", "TokenController", ")", "Delete", "(", "ctx", "*", "app", ".", "DeleteTokenContext", ")", "error", "{", "currentIdentity", ",", "err", ":=", "manager", ".", "ContextIdentity", "(", "ctx", ")", "\n", "if", "err", "!=", "nil", "{", ...
// Delete deletes the stored external provider token.
[ "Delete", "deletes", "the", "stored", "external", "provider", "token", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/token.go#L140-L155
150,721
fabric8-services/fabric8-auth
controller/token.go
Link
func (c *TokenController) Link(ctx *app.LinkTokenContext) error { if ctx.For == "" { return jsonapi.JSONErrorResponse(ctx, errors.NewBadParameterError("for", "").Expected("git or OpenShift resource URL")) } currentIdentity, err := c.app.UserService().ContextIdentityIfExists(ctx) if err != nil { return jsonapi.J...
go
func (c *TokenController) Link(ctx *app.LinkTokenContext) error { if ctx.For == "" { return jsonapi.JSONErrorResponse(ctx, errors.NewBadParameterError("for", "").Expected("git or OpenShift resource URL")) } currentIdentity, err := c.app.UserService().ContextIdentityIfExists(ctx) if err != nil { return jsonapi.J...
[ "func", "(", "c", "*", "TokenController", ")", "Link", "(", "ctx", "*", "app", ".", "LinkTokenContext", ")", "error", "{", "if", "ctx", ".", "For", "==", "\"", "\"", "{", "return", "jsonapi", ".", "JSONErrorResponse", "(", "ctx", ",", "errors", ".", ...
// Link links the user account to an external resource provider such as GitHub
[ "Link", "links", "the", "user", "account", "to", "an", "external", "resource", "provider", "such", "as", "GitHub" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/token.go#L307-L333
150,722
fabric8-services/fabric8-auth
controller/token.go
LinkCallback
func (c *TokenController) LinkCallback(ctx *app.LinkCallbackTokenContext) error { redirectLocation, err := c.app.LinkService().Callback(ctx, ctx.RequestData, ctx.State, ctx.Code) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } ctx.ResponseData.Header().Set("Location", redirectLocation) return ctx.Te...
go
func (c *TokenController) LinkCallback(ctx *app.LinkCallbackTokenContext) error { redirectLocation, err := c.app.LinkService().Callback(ctx, ctx.RequestData, ctx.State, ctx.Code) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } ctx.ResponseData.Header().Set("Location", redirectLocation) return ctx.Te...
[ "func", "(", "c", "*", "TokenController", ")", "LinkCallback", "(", "ctx", "*", "app", ".", "LinkCallbackTokenContext", ")", "error", "{", "redirectLocation", ",", "err", ":=", "c", ".", "app", ".", "LinkService", "(", ")", ".", "Callback", "(", "ctx", "...
// LinkCallback is called by an external oauth2 resource provider such as GitHub as part of user's account linking flow
[ "LinkCallback", "is", "called", "by", "an", "external", "oauth2", "resource", "provider", "such", "as", "GitHub", "as", "part", "of", "user", "s", "account", "linking", "flow" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/token.go#L336-L343
150,723
fabric8-services/fabric8-auth
authentication/provider/factory/linking_provider_factory.go
NewLinkingProviderFactory
func NewLinkingProviderFactory(context servicecontext.ServiceContext, config provider.LinkingProviderConfiguration) service.LinkingProviderFactory { factory := &linkingProviderFactoryImpl{ BaseService: base.NewBaseService(context), config: config, } return factory }
go
func NewLinkingProviderFactory(context servicecontext.ServiceContext, config provider.LinkingProviderConfiguration) service.LinkingProviderFactory { factory := &linkingProviderFactoryImpl{ BaseService: base.NewBaseService(context), config: config, } return factory }
[ "func", "NewLinkingProviderFactory", "(", "context", "servicecontext", ".", "ServiceContext", ",", "config", "provider", ".", "LinkingProviderConfiguration", ")", "service", ".", "LinkingProviderFactory", "{", "factory", ":=", "&", "linkingProviderFactoryImpl", "{", "Base...
// NewLinkingProviderFactory returns the default Linking provider factory.
[ "NewLinkingProviderFactory", "returns", "the", "default", "Linking", "provider", "factory", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/factory/linking_provider_factory.go#L20-L26
150,724
fabric8-services/fabric8-auth
authentication/account/repository/identity.go
LoadWithUser
func (m *GormIdentityRepository) LoadWithUser(ctx context.Context, id uuid.UUID) (*Identity, error) { identities, err := m.Query(IdentityFilterByID(id), IdentityWithUser()) if err != nil { return nil, err } if len(identities) == 0 { return nil, errs.WithStack(errors.NewNotFoundError("identity", id.String())) }...
go
func (m *GormIdentityRepository) LoadWithUser(ctx context.Context, id uuid.UUID) (*Identity, error) { identities, err := m.Query(IdentityFilterByID(id), IdentityWithUser()) if err != nil { return nil, err } if len(identities) == 0 { return nil, errs.WithStack(errors.NewNotFoundError("identity", id.String())) }...
[ "func", "(", "m", "*", "GormIdentityRepository", ")", "LoadWithUser", "(", "ctx", "context", ".", "Context", ",", "id", "uuid", ".", "UUID", ")", "(", "*", "Identity", ",", "error", ")", "{", "identities", ",", "err", ":=", "m", ".", "Query", "(", "I...
// LoadWithUser loads an identity and the associated User // Returns NotFoundError if either identity or user is not found
[ "LoadWithUser", "loads", "an", "identity", "and", "the", "associated", "User", "Returns", "NotFoundError", "if", "either", "identity", "or", "user", "is", "not", "found" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/identity.go#L184-L196
150,725
fabric8-services/fabric8-auth
authentication/account/repository/identity.go
Delete
func (m *GormIdentityRepository) Delete(ctx context.Context, id uuid.UUID, funcs ...func(*gorm.DB) *gorm.DB) error { defer goa.MeasureSince([]string{"goa", "db", "identity", "delete"}, time.Now()) obj := Identity{ID: id} result := m.db.Scopes(funcs...).Delete(obj) if result.Error != nil { log.Error(ctx, map[str...
go
func (m *GormIdentityRepository) Delete(ctx context.Context, id uuid.UUID, funcs ...func(*gorm.DB) *gorm.DB) error { defer goa.MeasureSince([]string{"goa", "db", "identity", "delete"}, time.Now()) obj := Identity{ID: id} result := m.db.Scopes(funcs...).Delete(obj) if result.Error != nil { log.Error(ctx, map[str...
[ "func", "(", "m", "*", "GormIdentityRepository", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "id", "uuid", ".", "UUID", ",", "funcs", "...", "func", "(", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", ")", "error", "{", "defer"...
// Delete removes a single record. argument funcs can be used to add conditions dynamically to current database connection
[ "Delete", "removes", "a", "single", "record", ".", "argument", "funcs", "can", "be", "used", "to", "add", "conditions", "dynamically", "to", "current", "database", "connection" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/identity.go#L269-L291
150,726
fabric8-services/fabric8-auth
authentication/account/repository/identity.go
IdentityFilterByUsername
func IdentityFilterByUsername(username string) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("username = ?", username).Limit(1) } }
go
func IdentityFilterByUsername(username string) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("username = ?", username).Limit(1) } }
[ "func", "IdentityFilterByUsername", "(", "username", "string", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "db", ...
// IdentityFilterByUsername is a gorm filter by 'username'
[ "IdentityFilterByUsername", "is", "a", "gorm", "filter", "by", "username" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/identity.go#L347-L351
150,727
fabric8-services/fabric8-auth
authentication/account/repository/identity.go
FindIdentitiesByResourceTypeWithParentResource
func (m *GormIdentityRepository) FindIdentitiesByResourceTypeWithParentResource(ctx context.Context, resourceTypeID uuid.UUID, parentResourceID string) ([]Identity, error) { defer goa.MeasureSince([]string{"goa", "db", "identity", "FindIdentitiesByResourceTypeWithParentResource"}, time.Now()) var identities []Identi...
go
func (m *GormIdentityRepository) FindIdentitiesByResourceTypeWithParentResource(ctx context.Context, resourceTypeID uuid.UUID, parentResourceID string) ([]Identity, error) { defer goa.MeasureSince([]string{"goa", "db", "identity", "FindIdentitiesByResourceTypeWithParentResource"}, time.Now()) var identities []Identi...
[ "func", "(", "m", "*", "GormIdentityRepository", ")", "FindIdentitiesByResourceTypeWithParentResource", "(", "ctx", "context", ".", "Context", ",", "resourceTypeID", "uuid", ".", "UUID", ",", "parentResourceID", "string", ")", "(", "[", "]", "Identity", ",", "erro...
// FindIdentitiesWithParentResource returns an array of Identity objects for which their corresponding resource is a child of the specified parent resource
[ "FindIdentitiesWithParentResource", "returns", "an", "array", "of", "Identity", "objects", "for", "which", "their", "corresponding", "resource", "is", "a", "child", "of", "the", "specified", "parent", "resource" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/identity.go#L581-L595
150,728
fabric8-services/fabric8-auth
authentication/account/repository/identity.go
RemoveMember
func (m *GormIdentityRepository) RemoveMember(ctx context.Context, memberOf uuid.UUID, memberID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "identity", "RemoveMember"}, time.Now()) membership := &Membership{ MemberOf: memberOf, MemberID: memberID, } err := m.db.Delete(membership).Error if...
go
func (m *GormIdentityRepository) RemoveMember(ctx context.Context, memberOf uuid.UUID, memberID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "identity", "RemoveMember"}, time.Now()) membership := &Membership{ MemberOf: memberOf, MemberID: memberID, } err := m.db.Delete(membership).Error if...
[ "func", "(", "m", "*", "GormIdentityRepository", ")", "RemoveMember", "(", "ctx", "context", ".", "Context", ",", "memberOf", "uuid", ".", "UUID", ",", "memberID", "uuid", ".", "UUID", ")", "error", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]"...
// RemoveMember removes an existing membership with the specified memberOf and memberID values
[ "RemoveMember", "removes", "an", "existing", "membership", "with", "the", "specified", "memberOf", "and", "memberID", "values" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/identity.go#L654-L688
150,729
fabric8-services/fabric8-auth
authentication/account/repository/identity.go
TouchLastActive
func (m *GormIdentityRepository) TouchLastActive(ctx context.Context, identityID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "identity", "TouchLastActive"}, time.Now()) err := m.db.Exec("UPDATE identities SET last_active = ?, deactivation_notification = NULL, deactivation_scheduled = NULL WHERE i...
go
func (m *GormIdentityRepository) TouchLastActive(ctx context.Context, identityID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "identity", "TouchLastActive"}, time.Now()) err := m.db.Exec("UPDATE identities SET last_active = ?, deactivation_notification = NULL, deactivation_scheduled = NULL WHERE i...
[ "func", "(", "m", "*", "GormIdentityRepository", ")", "TouchLastActive", "(", "ctx", "context", ".", "Context", ",", "identityID", "uuid", ".", "UUID", ")", "error", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", "{", "\"", "\"", ",",...
// TouchLastActive is intended to be a lightweight method that updates the last active column for a specified identity // to the current timestamp. Also, it resets the `deactivation_notification` timestamp so we can send another deactivation // notification to the user if she is once again inactive in the future.
[ "TouchLastActive", "is", "intended", "to", "be", "a", "lightweight", "method", "that", "updates", "the", "last", "active", "column", "for", "a", "specified", "identity", "to", "the", "current", "timestamp", ".", "Also", "it", "resets", "the", "deactivation_notif...
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/identity.go#L895-L908
150,730
fabric8-services/fabric8-auth
notification/service/notification.go
NewNotificationService
func NewNotificationService(context servicecontext.ServiceContext, config notification.Configuration) service.NotificationService { return &notificationServiceImpl{ BaseService: base.NewBaseService(context), config: config, } }
go
func NewNotificationService(context servicecontext.ServiceContext, config notification.Configuration) service.NotificationService { return &notificationServiceImpl{ BaseService: base.NewBaseService(context), config: config, } }
[ "func", "NewNotificationService", "(", "context", "servicecontext", ".", "ServiceContext", ",", "config", "notification", ".", "Configuration", ")", "service", ".", "NotificationService", "{", "return", "&", "notificationServiceImpl", "{", "BaseService", ":", "base", ...
// NewNotificationService creates a new service.
[ "NewNotificationService", "creates", "a", "new", "service", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/notification/service/notification.go#L31-L36
150,731
fabric8-services/fabric8-auth
authorization/space/service/space_service.go
NewSpaceService
func NewSpaceService(context servicecontext.ServiceContext) service.SpaceService { return &spaceService{base.NewBaseService(context)} }
go
func NewSpaceService(context servicecontext.ServiceContext) service.SpaceService { return &spaceService{base.NewBaseService(context)} }
[ "func", "NewSpaceService", "(", "context", "servicecontext", ".", "ServiceContext", ")", "service", ".", "SpaceService", "{", "return", "&", "spaceService", "{", "base", ".", "NewBaseService", "(", "context", ")", "}", "\n", "}" ]
// NewSpaceService creates a new space service.
[ "NewSpaceService", "creates", "a", "new", "space", "service", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/space/service/space_service.go#L21-L23
150,732
fabric8-services/fabric8-auth
gormapplication/application.go
BeginTransaction
func (g *GormDB) BeginTransaction() (transaction.Transaction, error) { tx := g.db.Begin() if tx.Error != nil { return nil, tx.Error } if len(g.txIsoLevel) != 0 { tx := tx.Exec(fmt.Sprintf("set transaction isolation level %s", g.txIsoLevel)) if tx.Error != nil { return nil, tx.Error } return &GormTransa...
go
func (g *GormDB) BeginTransaction() (transaction.Transaction, error) { tx := g.db.Begin() if tx.Error != nil { return nil, tx.Error } if len(g.txIsoLevel) != 0 { tx := tx.Exec(fmt.Sprintf("set transaction isolation level %s", g.txIsoLevel)) if tx.Error != nil { return nil, tx.Error } return &GormTransa...
[ "func", "(", "g", "*", "GormDB", ")", "BeginTransaction", "(", ")", "(", "transaction", ".", "Transaction", ",", "error", ")", "{", "tx", ":=", "g", ".", "db", ".", "Begin", "(", ")", "\n", "if", "tx", ".", "Error", "!=", "nil", "{", "return", "n...
// BeginTransaction initiates a new transaction
[ "BeginTransaction", "initiates", "a", "new", "transaction" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/gormapplication/application.go#L276-L289
150,733
fabric8-services/fabric8-auth
authentication/provider/oauth2.go
UserProfilePayload
func (provider *DefaultIdentityProvider) UserProfilePayload(ctx context.Context, token oauth2.Token) ([]byte, error) { req, err := http.NewRequest("GET", provider.ProfileURL, nil) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err.Error(), "profile_url": provider.ProfileURL, }, "unabl...
go
func (provider *DefaultIdentityProvider) UserProfilePayload(ctx context.Context, token oauth2.Token) ([]byte, error) { req, err := http.NewRequest("GET", provider.ProfileURL, nil) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err.Error(), "profile_url": provider.ProfileURL, }, "unabl...
[ "func", "(", "provider", "*", "DefaultIdentityProvider", ")", "UserProfilePayload", "(", "ctx", "context", ".", "Context", ",", "token", "oauth2", ".", "Token", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "req", ",", "err", ":=", "http", ".", "...
// UserProfilePayload fetches user profile payload from Identity Provider. It is used by the Profile function to do // the actual work of talking to the identity provider
[ "UserProfilePayload", "fetches", "user", "profile", "payload", "from", "Identity", "Provider", ".", "It", "is", "used", "by", "the", "Profile", "function", "to", "do", "the", "actual", "work", "of", "talking", "to", "the", "identity", "provider" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/oauth2.go#L156-L192
150,734
fabric8-services/fabric8-auth
goasupport/forward_signer.go
Sign
func (f JWTSigner) Sign(request *http.Request) error { request.Header.Set("Authorization", "Bearer "+f.Token) return nil }
go
func (f JWTSigner) Sign(request *http.Request) error { request.Header.Set("Authorization", "Bearer "+f.Token) return nil }
[ "func", "(", "f", "JWTSigner", ")", "Sign", "(", "request", "*", "http", ".", "Request", ")", "error", "{", "request", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", "+", "f", ".", "Token", ")", "\n", "return", "nil", "\n", "}" ]
// Sign sets the Auth header
[ "Sign", "sets", "the", "Auth", "header" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/goasupport/forward_signer.go#L17-L20
150,735
fabric8-services/fabric8-auth
goasupport/forward_signer.go
NewForwardSigner
func NewForwardSigner(ctx context.Context) goaclient.Signer { return &JWTSigner{Token: goajwt.ContextJWT(ctx).Raw} }
go
func NewForwardSigner(ctx context.Context) goaclient.Signer { return &JWTSigner{Token: goajwt.ContextJWT(ctx).Raw} }
[ "func", "NewForwardSigner", "(", "ctx", "context", ".", "Context", ")", "goaclient", ".", "Signer", "{", "return", "&", "JWTSigner", "{", "Token", ":", "goajwt", ".", "ContextJWT", "(", "ctx", ")", ".", "Raw", "}", "\n", "}" ]
// NewForwardSigner returns a new signer which uses the token from the context // If the caller context is used then the token from this context will be extracted and forwarded to the target Request
[ "NewForwardSigner", "returns", "a", "new", "signer", "which", "uses", "the", "token", "from", "the", "context", "If", "the", "caller", "context", "is", "used", "then", "the", "token", "from", "this", "context", "will", "be", "extracted", "and", "forwarded", ...
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/goasupport/forward_signer.go#L24-L26
150,736
fabric8-services/fabric8-auth
application/repository/base/exister.go
exists
func exists(ctx context.Context, db *gorm.DB, tableName, idColumnName, id string, softDeletable bool) (bool, error) { var exists bool var query string if softDeletable { query = fmt.Sprintf(` SELECT EXISTS ( SELECT 1 FROM %[1]s WHERE %[2]s=$1 AND deleted_at IS NULL )`, tableName, idColumnName) }...
go
func exists(ctx context.Context, db *gorm.DB, tableName, idColumnName, id string, softDeletable bool) (bool, error) { var exists bool var query string if softDeletable { query = fmt.Sprintf(` SELECT EXISTS ( SELECT 1 FROM %[1]s WHERE %[2]s=$1 AND deleted_at IS NULL )`, tableName, idColumnName) }...
[ "func", "exists", "(", "ctx", "context", ".", "Context", ",", "db", "*", "gorm", ".", "DB", ",", "tableName", ",", "idColumnName", ",", "id", "string", ",", "softDeletable", "bool", ")", "(", "bool", ",", "error", ")", "{", "var", "exists", "bool", "...
// exists returns true if a soft or hard deletable item exists in the database table with a given ID
[ "exists", "returns", "true", "if", "a", "soft", "or", "hard", "deletable", "item", "exists", "in", "the", "database", "table", "with", "a", "given", "ID" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/application/repository/base/exister.go#L21-L48
150,737
fabric8-services/fabric8-auth
application/repository/base/exister.go
CheckExists
func CheckExists(ctx context.Context, db *gorm.DB, tableName string, id string) error { _, err := exists(ctx, db, tableName, "id", id, true) return err }
go
func CheckExists(ctx context.Context, db *gorm.DB, tableName string, id string) error { _, err := exists(ctx, db, tableName, "id", id, true) return err }
[ "func", "CheckExists", "(", "ctx", "context", ".", "Context", ",", "db", "*", "gorm", ".", "DB", ",", "tableName", "string", ",", "id", "string", ")", "error", "{", "_", ",", "err", ":=", "exists", "(", "ctx", ",", "db", ",", "tableName", ",", "\""...
// CheckExists does the same as Exists for a soft deletable item but only returns the error value; thereby // being a handy convenience function.
[ "CheckExists", "does", "the", "same", "as", "Exists", "for", "a", "soft", "deletable", "item", "but", "only", "returns", "the", "error", "value", ";", "thereby", "being", "a", "handy", "convenience", "function", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/application/repository/base/exister.go#L52-L55
150,738
fabric8-services/fabric8-auth
application/repository/base/exister.go
CheckHardDeletableExists
func CheckHardDeletableExists(ctx context.Context, db *gorm.DB, tableName string, id string) error { _, err := exists(ctx, db, tableName, "id", id, false) return err }
go
func CheckHardDeletableExists(ctx context.Context, db *gorm.DB, tableName string, id string) error { _, err := exists(ctx, db, tableName, "id", id, false) return err }
[ "func", "CheckHardDeletableExists", "(", "ctx", "context", ".", "Context", ",", "db", "*", "gorm", ".", "DB", ",", "tableName", "string", ",", "id", "string", ")", "error", "{", "_", ",", "err", ":=", "exists", "(", "ctx", ",", "db", ",", "tableName", ...
// CheckExists does the same as Exists for a hard deletable item but only returns the error value; thereby // being a handy convenience function.
[ "CheckExists", "does", "the", "same", "as", "Exists", "for", "a", "hard", "deletable", "item", "but", "only", "returns", "the", "error", "value", ";", "thereby", "being", "a", "handy", "convenience", "function", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/application/repository/base/exister.go#L66-L69
150,739
fabric8-services/fabric8-auth
controller/user.go
ListResources
func (c *UserController) ListResources(ctx *app.ListResourcesUserContext) error { // retrieve the user's identity ID from the token identityID, err := c.tokenManager.Locate(ctx) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "Bad Token") return jsonapi.JSONErrorResponse(ctx, errors.Ne...
go
func (c *UserController) ListResources(ctx *app.ListResourcesUserContext) error { // retrieve the user's identity ID from the token identityID, err := c.tokenManager.Locate(ctx) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "Bad Token") return jsonapi.JSONErrorResponse(ctx, errors.Ne...
[ "func", "(", "c", "*", "UserController", ")", "ListResources", "(", "ctx", "*", "app", ".", "ListResourcesUserContext", ")", "error", "{", "// retrieve the user's identity ID from the token", "identityID", ",", "err", ":=", "c", ".", "tokenManager", ".", "Locate", ...
// ListResources returns a list of resources in which the current user has a role
[ "ListResources", "returns", "a", "list", "of", "resources", "in", "which", "the", "current", "user", "has", "a", "role" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/user.go#L77-L97
150,740
fabric8-services/fabric8-auth
controller/user.go
convertToUserResources
func convertToUserResources(request *goa.RequestData, resourceType string, resourceIDs []string) *app.UserResourcesList { data := make([]*app.UserResourceData, 0) for _, resourceID := range resourceIDs { resourceHref := rest.AbsoluteURL(request, app.ResourceHref(resourceID), nil) data = append(data, &app.UserReso...
go
func convertToUserResources(request *goa.RequestData, resourceType string, resourceIDs []string) *app.UserResourcesList { data := make([]*app.UserResourceData, 0) for _, resourceID := range resourceIDs { resourceHref := rest.AbsoluteURL(request, app.ResourceHref(resourceID), nil) data = append(data, &app.UserReso...
[ "func", "convertToUserResources", "(", "request", "*", "goa", ".", "RequestData", ",", "resourceType", "string", ",", "resourceIDs", "[", "]", "string", ")", "*", "app", ".", "UserResourcesList", "{", "data", ":=", "make", "(", "[", "]", "*", "app", ".", ...
// convertToUserResources converts a list of resources to which the user has a role
[ "convertToUserResources", "converts", "a", "list", "of", "resources", "to", "which", "the", "user", "has", "a", "role" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/user.go#L100-L115
150,741
fabric8-services/fabric8-auth
worker/repository/worker_lock_repository.go
AcquireLock
func (r *lockRepositoryImpl) AcquireLock(ctx context.Context, owner, name string, opts ...pglock.ClientOption) (*pglock.Lock, error) { log.Info(ctx, map[string]interface{}{ "lock": name, "owner": owner, }, "acquiring lock...") // obtain a lock to prevent other pods to perform this task var clnOpts []pglock.Cli...
go
func (r *lockRepositoryImpl) AcquireLock(ctx context.Context, owner, name string, opts ...pglock.ClientOption) (*pglock.Lock, error) { log.Info(ctx, map[string]interface{}{ "lock": name, "owner": owner, }, "acquiring lock...") // obtain a lock to prevent other pods to perform this task var clnOpts []pglock.Cli...
[ "func", "(", "r", "*", "lockRepositoryImpl", ")", "AcquireLock", "(", "ctx", "context", ".", "Context", ",", "owner", ",", "name", "string", ",", "opts", "...", "pglock", ".", "ClientOption", ")", "(", "*", "pglock", ".", "Lock", ",", "error", ")", "{"...
// AcquireLock acquires a lock with the given name for the given owner // Returns an error if the lock could not be obtained
[ "AcquireLock", "acquires", "a", "lock", "with", "the", "given", "name", "for", "the", "given", "owner", "Returns", "an", "error", "if", "the", "lock", "could", "not", "be", "obtained" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/worker/repository/worker_lock_repository.go#L33-L81
150,742
fabric8-services/fabric8-auth
worker/repository/worker_lock_repository.go
GetLock
func (r *lockRepositoryImpl) GetLock(ctx context.Context, name string) (*pglock.Lock, error) { log.Debug(ctx, map[string]interface{}{ "lock": name, }, "obtaining existing lock...") opts := []pglock.ClientOption{ pglock.WithCustomTable("worker_lock"), pglock.WithLogger(log.Logger()), } c, err := pglock.New(r....
go
func (r *lockRepositoryImpl) GetLock(ctx context.Context, name string) (*pglock.Lock, error) { log.Debug(ctx, map[string]interface{}{ "lock": name, }, "obtaining existing lock...") opts := []pglock.ClientOption{ pglock.WithCustomTable("worker_lock"), pglock.WithLogger(log.Logger()), } c, err := pglock.New(r....
[ "func", "(", "r", "*", "lockRepositoryImpl", ")", "GetLock", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "*", "pglock", ".", "Lock", ",", "error", ")", "{", "log", ".", "Debug", "(", "ctx", ",", "map", "[", "string", "]"...
// GetLock returns the lock object from the given name in the table without holding // it first.
[ "GetLock", "returns", "the", "lock", "object", "from", "the", "given", "name", "in", "the", "table", "without", "holding", "it", "first", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/worker/repository/worker_lock_repository.go#L85-L105
150,743
fabric8-services/fabric8-auth
authorization/invitation/service/invitation_service.go
processTeamInviteNotifications
func (s *invitationServiceImpl) processTeamInviteNotifications(ctx context.Context, team *account.Identity, inviterName string, notifications []invitationNotification) error { teamName := team.IdentityResource.Name var spaceName string res, err := s.Repositories().ResourceRepository().Load(ctx, team.IdentityResour...
go
func (s *invitationServiceImpl) processTeamInviteNotifications(ctx context.Context, team *account.Identity, inviterName string, notifications []invitationNotification) error { teamName := team.IdentityResource.Name var spaceName string res, err := s.Repositories().ResourceRepository().Load(ctx, team.IdentityResour...
[ "func", "(", "s", "*", "invitationServiceImpl", ")", "processTeamInviteNotifications", "(", "ctx", "context", ".", "Context", ",", "team", "*", "account", ".", "Identity", ",", "inviterName", "string", ",", "notifications", "[", "]", "invitationNotification", ")",...
// processTeamInviteNotifications sends an e-mail notification to a user.
[ "processTeamInviteNotifications", "sends", "an", "e", "-", "mail", "notification", "to", "a", "user", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/invitation/service/invitation_service.go#L247-L280
150,744
fabric8-services/fabric8-auth
authorization/invitation/service/invitation_service.go
processSpaceInviteNotifications
func (s *invitationServiceImpl) processSpaceInviteNotifications(ctx context.Context, space *resource.Resource, inviterName string, notifications []invitationNotification) error { sp, err := s.Services().WITService().GetSpace(ctx, space.ResourceID) if err != nil { return err } spaceName := sp.Name var messages ...
go
func (s *invitationServiceImpl) processSpaceInviteNotifications(ctx context.Context, space *resource.Resource, inviterName string, notifications []invitationNotification) error { sp, err := s.Services().WITService().GetSpace(ctx, space.ResourceID) if err != nil { return err } spaceName := sp.Name var messages ...
[ "func", "(", "s", "*", "invitationServiceImpl", ")", "processSpaceInviteNotifications", "(", "ctx", "context", ".", "Context", ",", "space", "*", "resource", ".", "Resource", ",", "inviterName", "string", ",", "notifications", "[", "]", "invitationNotification", "...
// processSpaceInviteNotifications sends an e-mail notification to a user.
[ "processSpaceInviteNotifications", "sends", "an", "e", "-", "mail", "notification", "to", "a", "user", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/invitation/service/invitation_service.go#L283-L304
150,745
fabric8-services/fabric8-auth
authorization/invitation/service/invitation_service.go
Rescind
func (s *invitationServiceImpl) Rescind(ctx context.Context, rescindingUserID, invitationID uuid.UUID) error { // Locate the invitation inv, err := s.Repositories().InvitationRepository().Load(ctx, invitationID) if err != nil { return errors.NewNotFoundErrorFromString(fmt.Sprintf("invalid identifier '%s' provided ...
go
func (s *invitationServiceImpl) Rescind(ctx context.Context, rescindingUserID, invitationID uuid.UUID) error { // Locate the invitation inv, err := s.Repositories().InvitationRepository().Load(ctx, invitationID) if err != nil { return errors.NewNotFoundErrorFromString(fmt.Sprintf("invalid identifier '%s' provided ...
[ "func", "(", "s", "*", "invitationServiceImpl", ")", "Rescind", "(", "ctx", "context", ".", "Context", ",", "rescindingUserID", ",", "invitationID", "uuid", ".", "UUID", ")", "error", "{", "// Locate the invitation", "inv", ",", "err", ":=", "s", ".", "Repos...
// Rescind revokes an invitation request
[ "Rescind", "revokes", "an", "invitation", "request" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/invitation/service/invitation_service.go#L307-L357
150,746
fabric8-services/fabric8-auth
gormsupport/lifecycle_hard_delete.go
Equal
func (lc LifecycleHardDelete) Equal(u convert.Equaler) bool { other, ok := u.(LifecycleHardDelete) return ok && lc.CreatedAt.Equal(other.CreatedAt) && lc.UpdatedAt.Equal(other.UpdatedAt) }
go
func (lc LifecycleHardDelete) Equal(u convert.Equaler) bool { other, ok := u.(LifecycleHardDelete) return ok && lc.CreatedAt.Equal(other.CreatedAt) && lc.UpdatedAt.Equal(other.UpdatedAt) }
[ "func", "(", "lc", "LifecycleHardDelete", ")", "Equal", "(", "u", "convert", ".", "Equaler", ")", "bool", "{", "other", ",", "ok", ":=", "u", ".", "(", "LifecycleHardDelete", ")", "\n", "return", "ok", "&&", "lc", ".", "CreatedAt", ".", "Equal", "(", ...
// Equal returns true if two LifecycleHardDelete objects are equal; otherwise false is returned.
[ "Equal", "returns", "true", "if", "two", "LifecycleHardDelete", "objects", "are", "equal", ";", "otherwise", "false", "is", "returned", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/gormsupport/lifecycle_hard_delete.go#L26-L29
150,747
fabric8-services/fabric8-auth
authentication/account/repository/verification_code.go
LoadByCode
func (m *GormVerificationCodeRepository) LoadByCode(ctx context.Context, code string) ([]VerificationCode, error) { return m.Query(VerificationCodeWithUser(), VerificationCodeFilterByCode(code)) // maybe load with user? }
go
func (m *GormVerificationCodeRepository) LoadByCode(ctx context.Context, code string) ([]VerificationCode, error) { return m.Query(VerificationCodeWithUser(), VerificationCodeFilterByCode(code)) // maybe load with user? }
[ "func", "(", "m", "*", "GormVerificationCodeRepository", ")", "LoadByCode", "(", "ctx", "context", ".", "Context", ",", "code", "string", ")", "(", "[", "]", "VerificationCode", ",", "error", ")", "{", "return", "m", ".", "Query", "(", "VerificationCodeWithU...
// LoadByCode loads result by filtering with respect to the verificate code.
[ "LoadByCode", "loads", "result", "by", "filtering", "with", "respect", "to", "the", "verificate", "code", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/verification_code.go#L78-L80
150,748
fabric8-services/fabric8-auth
authentication/account/repository/verification_code.go
VerificationCodeFilterByUserID
func VerificationCodeFilterByUserID(userID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("user_id = ?", userID) } }
go
func VerificationCodeFilterByUserID(userID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("user_id = ?", userID) } }
[ "func", "VerificationCodeFilterByUserID", "(", "userID", "uuid", ".", "UUID", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", ...
// VerificationCodeFilterByUserID is a gorm filter for a Belongs To relationship.
[ "VerificationCodeFilterByUserID", "is", "a", "gorm", "filter", "for", "a", "Belongs", "To", "relationship", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/verification_code.go#L170-L174
150,749
fabric8-services/fabric8-auth
authentication/account/repository/verification_code.go
VerificationCodeFilterByCode
func VerificationCodeFilterByCode(code string) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("code = ?", code) } }
go
func VerificationCodeFilterByCode(code string) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("code = ?", code) } }
[ "func", "VerificationCodeFilterByCode", "(", "code", "string", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "db", ...
// VerificationCodeFilterByCode is a gorm filter for a Belongs To relationship.
[ "VerificationCodeFilterByCode", "is", "a", "gorm", "filter", "for", "a", "Belongs", "To", "relationship", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/verification_code.go#L177-L181
150,750
fabric8-services/fabric8-auth
authentication/account/repository/verification_code.go
VerificationCodeWithUser
func VerificationCodeWithUser() func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Preload("User") } }
go
func VerificationCodeWithUser() func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Preload("User") } }
[ "func", "VerificationCodeWithUser", "(", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "db", ".", "Preload", "(",...
// VerificationCodeWithUser is a gorm filter for preloading the user relationship.
[ "VerificationCodeWithUser", "is", "a", "gorm", "filter", "for", "preloading", "the", "user", "relationship", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/account/repository/verification_code.go#L184-L188
150,751
fabric8-services/fabric8-auth
notification/notification.go
NewUserEmailUpdated
func NewUserEmailUpdated(identityID string, custom map[string]interface{}) Message { return Message{ MessageID: uuid.NewV4(), MessageType: "user.email.update", TargetID: identityID, UserID: &identityID, // in future if service accounts are allowed to update, this will be handy. Custom: custom,...
go
func NewUserEmailUpdated(identityID string, custom map[string]interface{}) Message { return Message{ MessageID: uuid.NewV4(), MessageType: "user.email.update", TargetID: identityID, UserID: &identityID, // in future if service accounts are allowed to update, this will be handy. Custom: custom,...
[ "func", "NewUserEmailUpdated", "(", "identityID", "string", ",", "custom", "map", "[", "string", "]", "interface", "{", "}", ")", "Message", "{", "return", "Message", "{", "MessageID", ":", "uuid", ".", "NewV4", "(", ")", ",", "MessageType", ":", "\"", "...
// NewUserEmailUpdated is a helper constructor which returns a Message with contents of the notification // that would be sent out.
[ "NewUserEmailUpdated", "is", "a", "helper", "constructor", "which", "returns", "a", "Message", "with", "contents", "of", "the", "notification", "that", "would", "be", "sent", "out", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/notification/notification.go#L29-L37
150,752
fabric8-services/fabric8-auth
notification/notification.go
NewUserDeactivationEmail
func NewUserDeactivationEmail(identityID, email, deactivationDate string) Message { return Message{ MessageID: uuid.NewV4(), MessageType: "user.deactivation", TargetID: identityID, UserID: &identityID, Custom: map[string]interface{}{ "userEmail": email, "expiryDate": deactivationDate, }, ...
go
func NewUserDeactivationEmail(identityID, email, deactivationDate string) Message { return Message{ MessageID: uuid.NewV4(), MessageType: "user.deactivation", TargetID: identityID, UserID: &identityID, Custom: map[string]interface{}{ "userEmail": email, "expiryDate": deactivationDate, }, ...
[ "func", "NewUserDeactivationEmail", "(", "identityID", ",", "email", ",", "deactivationDate", "string", ")", "Message", "{", "return", "Message", "{", "MessageID", ":", "uuid", ".", "NewV4", "(", ")", ",", "MessageType", ":", "\"", "\"", ",", "TargetID", ":"...
// NewUserDeactivationEmail is a helper constructor which returns a message to inform the user that her // account will be deactivated soon
[ "NewUserDeactivationEmail", "is", "a", "helper", "constructor", "which", "returns", "a", "message", "to", "inform", "the", "user", "that", "her", "account", "will", "be", "deactivated", "soon" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/notification/notification.go#L87-L98
150,753
fabric8-services/fabric8-auth
authorization/role/service/role_management_service.go
ListByResourceAndRoleName
func (s *roleManagementServiceImpl) ListByResourceAndRoleName(ctx context.Context, currentIdentity uuid.UUID, resourceID string, roleName string) ([]rolerepo.IdentityRole, error) { err := s.requireViewRolesScope(ctx, currentIdentity, resourceID) if err != nil { return nil, err } return s.Repositories().IdentityR...
go
func (s *roleManagementServiceImpl) ListByResourceAndRoleName(ctx context.Context, currentIdentity uuid.UUID, resourceID string, roleName string) ([]rolerepo.IdentityRole, error) { err := s.requireViewRolesScope(ctx, currentIdentity, resourceID) if err != nil { return nil, err } return s.Repositories().IdentityR...
[ "func", "(", "s", "*", "roleManagementServiceImpl", ")", "ListByResourceAndRoleName", "(", "ctx", "context", ".", "Context", ",", "currentIdentity", "uuid", ".", "UUID", ",", "resourceID", "string", ",", "roleName", "string", ")", "(", "[", "]", "rolerepo", "....
// ListByResourceAndRoleName lists specific roles for the resource if the current user has permissions to view the roles
[ "ListByResourceAndRoleName", "lists", "specific", "roles", "for", "the", "resource", "if", "the", "current", "user", "has", "permissions", "to", "view", "the", "roles" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/service/role_management_service.go#L30-L37
150,754
fabric8-services/fabric8-auth
authorization/role/service/role_management_service.go
ListByResource
func (s *roleManagementServiceImpl) ListByResource(ctx context.Context, currentIdentity uuid.UUID, resourceID string) ([]rolerepo.IdentityRole, error) { err := s.requireViewRolesScope(ctx, currentIdentity, resourceID) if err != nil { return nil, err } return s.Repositories().IdentityRoleRepository().FindIdentity...
go
func (s *roleManagementServiceImpl) ListByResource(ctx context.Context, currentIdentity uuid.UUID, resourceID string) ([]rolerepo.IdentityRole, error) { err := s.requireViewRolesScope(ctx, currentIdentity, resourceID) if err != nil { return nil, err } return s.Repositories().IdentityRoleRepository().FindIdentity...
[ "func", "(", "s", "*", "roleManagementServiceImpl", ")", "ListByResource", "(", "ctx", "context", ".", "Context", ",", "currentIdentity", "uuid", ".", "UUID", ",", "resourceID", "string", ")", "(", "[", "]", "rolerepo", ".", "IdentityRole", ",", "error", ")"...
// ListByResource lists all identity roles for the resource if the current user has permissions to view the roles
[ "ListByResource", "lists", "all", "identity", "roles", "for", "the", "resource", "if", "the", "current", "user", "has", "permissions", "to", "view", "the", "roles" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/service/role_management_service.go#L40-L47
150,755
fabric8-services/fabric8-auth
authorization/role/service/role_management_service.go
ListAvailableRolesByResourceType
func (s *roleManagementServiceImpl) ListAvailableRolesByResourceType(ctx context.Context, resourceType string) ([]role.RoleDescriptor, error) { return s.Repositories().RoleRepository().FindRolesByResourceType(ctx, resourceType) }
go
func (s *roleManagementServiceImpl) ListAvailableRolesByResourceType(ctx context.Context, resourceType string) ([]role.RoleDescriptor, error) { return s.Repositories().RoleRepository().FindRolesByResourceType(ctx, resourceType) }
[ "func", "(", "s", "*", "roleManagementServiceImpl", ")", "ListAvailableRolesByResourceType", "(", "ctx", "context", ".", "Context", ",", "resourceType", "string", ")", "(", "[", "]", "role", ".", "RoleDescriptor", ",", "error", ")", "{", "return", "s", ".", ...
// ListAvailableRolesByResourceType lists role assignments of a specific resource.
[ "ListAvailableRolesByResourceType", "lists", "role", "assignments", "of", "a", "specific", "resource", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/service/role_management_service.go#L61-L63
150,756
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
DefaultManager
func DefaultManager(config TokenManagerConfiguration) (TokenManager, error) { defaultOnce.Do(func() { defaultManager, defaultErr = NewTokenManager(config) }) return defaultManager, defaultErr }
go
func DefaultManager(config TokenManagerConfiguration) (TokenManager, error) { defaultOnce.Do(func() { defaultManager, defaultErr = NewTokenManager(config) }) return defaultManager, defaultErr }
[ "func", "DefaultManager", "(", "config", "TokenManagerConfiguration", ")", "(", "TokenManager", ",", "error", ")", "{", "defaultOnce", ".", "Do", "(", "func", "(", ")", "{", "defaultManager", ",", "defaultErr", "=", "NewTokenManager", "(", "config", ")", "\n",...
// DefaultManager creates the default manager if it has not created yet. // This function must be called in main to make sure the default manager is created during service startup. // It will try to create the default manager only once even if called multiple times.
[ "DefaultManager", "creates", "the", "default", "manager", "if", "it", "has", "not", "created", "yet", ".", "This", "function", "must", "be", "called", "in", "main", "to", "make", "sure", "the", "default", "manager", "is", "created", "during", "service", "sta...
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L46-L51
150,757
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
ReadTokenSetFromJson
func ReadTokenSetFromJson(ctx context.Context, jsonString string) (*TokenSet, error) { var token TokenSet err := json.Unmarshal([]byte(jsonString), &token) if err != nil { return nil, errors.Wrapf(err, "error when unmarshal json with access token %s ", jsonString) } return &token, nil }
go
func ReadTokenSetFromJson(ctx context.Context, jsonString string) (*TokenSet, error) { var token TokenSet err := json.Unmarshal([]byte(jsonString), &token) if err != nil { return nil, errors.Wrapf(err, "error when unmarshal json with access token %s ", jsonString) } return &token, nil }
[ "func", "ReadTokenSetFromJson", "(", "ctx", "context", ".", "Context", ",", "jsonString", "string", ")", "(", "*", "TokenSet", ",", "error", ")", "{", "var", "token", "TokenSet", "\n", "err", ":=", "json", ".", "Unmarshal", "(", "[", "]", "byte", "(", ...
// ReadTokenSetFromJson parses json with a token set
[ "ReadTokenSetFromJson", "parses", "json", "with", "a", "token", "set" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L107-L114
150,758
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
ReadTokenManagerFromContext
func ReadTokenManagerFromContext(ctx context.Context) (TokenManager, error) { tm := ctx.Value(contextTokenManagerKey) if tm == nil { log.Error(ctx, map[string]interface{}{ "token": tm, }, "missing token manager") return nil, errors.New("missing token manager") } return tm.(*tokenManager), nil }
go
func ReadTokenManagerFromContext(ctx context.Context) (TokenManager, error) { tm := ctx.Value(contextTokenManagerKey) if tm == nil { log.Error(ctx, map[string]interface{}{ "token": tm, }, "missing token manager") return nil, errors.New("missing token manager") } return tm.(*tokenManager), nil }
[ "func", "ReadTokenManagerFromContext", "(", "ctx", "context", ".", "Context", ")", "(", "TokenManager", ",", "error", ")", "{", "tm", ":=", "ctx", ".", "Value", "(", "contextTokenManagerKey", ")", "\n", "if", "tm", "==", "nil", "{", "log", ".", "Error", ...
// ReadTokenManagerFromContext extracts the token manager from the context and returns it
[ "ReadTokenManagerFromContext", "extracts", "the", "token", "manager", "from", "the", "context", "and", "returns", "it" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L154-L164
150,759
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
NewTokenManager
func NewTokenManager(config TokenManagerConfiguration) (TokenManager, error) { tm := &tokenManager{ publicKeysMap: map[string]*rsa.PublicKey{}, } tm.config = config // Load the user account private key and add it to the manager. // Extract the public key from it and add it to the map of public keys. var err er...
go
func NewTokenManager(config TokenManagerConfiguration) (TokenManager, error) { tm := &tokenManager{ publicKeysMap: map[string]*rsa.PublicKey{}, } tm.config = config // Load the user account private key and add it to the manager. // Extract the public key from it and add it to the map of public keys. var err er...
[ "func", "NewTokenManager", "(", "config", "TokenManagerConfiguration", ")", "(", "TokenManager", ",", "error", ")", "{", "tm", ":=", "&", "tokenManager", "{", "publicKeysMap", ":", "map", "[", "string", "]", "*", "rsa", ".", "PublicKey", "{", "}", ",", "}"...
// NewTokenManager returns a new token Manager for handling tokens
[ "NewTokenManager", "returns", "a", "new", "token", "Manager", "for", "handling", "tokens" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L221-L279
150,760
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
SignRPTToken
func (mgm *tokenManager) SignRPTToken(ctx context.Context, rptToken *jwt.Token) (string, error) { return rptToken.SignedString(mgm.userAccountPrivateKey.Key) }
go
func (mgm *tokenManager) SignRPTToken(ctx context.Context, rptToken *jwt.Token) (string, error) { return rptToken.SignedString(mgm.userAccountPrivateKey.Key) }
[ "func", "(", "mgm", "*", "tokenManager", ")", "SignRPTToken", "(", "ctx", "context", ".", "Context", ",", "rptToken", "*", "jwt", ".", "Token", ")", "(", "string", ",", "error", ")", "{", "return", "rptToken", ".", "SignedString", "(", "mgm", ".", "use...
// SignRPTToken generates a signature for the specified rpt token and returns it
[ "SignRPTToken", "generates", "a", "signature", "for", "the", "specified", "rpt", "token", "and", "returns", "it" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L389-L391
150,761
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
GenerateUnsignedUserAccessTokenForIdentity
func (m *tokenManager) GenerateUnsignedUserAccessTokenForIdentity(ctx context.Context, identity repository.Identity) (*jwt.Token, error) { token := jwt.New(jwt.SigningMethodRS256) token.Header["kid"] = m.userAccountPrivateKey.KeyID req := goa.ContextRequest(ctx) if req == nil { return nil, errors.New("missing re...
go
func (m *tokenManager) GenerateUnsignedUserAccessTokenForIdentity(ctx context.Context, identity repository.Identity) (*jwt.Token, error) { token := jwt.New(jwt.SigningMethodRS256) token.Header["kid"] = m.userAccountPrivateKey.KeyID req := goa.ContextRequest(ctx) if req == nil { return nil, errors.New("missing re...
[ "func", "(", "m", "*", "tokenManager", ")", "GenerateUnsignedUserAccessTokenForIdentity", "(", "ctx", "context", ".", "Context", ",", "identity", "repository", ".", "Identity", ")", "(", "*", "jwt", ".", "Token", ",", "error", ")", "{", "token", ":=", "jwt",...
// GenerateUnsignedUserAccessTokenForIdentity generates an unsigned OAuth2 user access token for the given identity
[ "GenerateUnsignedUserAccessTokenForIdentity", "generates", "an", "unsigned", "OAuth2", "user", "access", "token", "for", "the", "given", "identity" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L476-L516
150,762
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
GenerateTransientUserAccessTokenForIdentity
func (m *tokenManager) GenerateTransientUserAccessTokenForIdentity(ctx context.Context, identity repository.Identity) (*string, error) { token, err := m.GenerateUnsignedUserAccessTokenForIdentity(ctx, identity) if err != nil { return nil, err } claims := token.Claims.(jwt.MapClaims) iat := time.Now().Unix() cl...
go
func (m *tokenManager) GenerateTransientUserAccessTokenForIdentity(ctx context.Context, identity repository.Identity) (*string, error) { token, err := m.GenerateUnsignedUserAccessTokenForIdentity(ctx, identity) if err != nil { return nil, err } claims := token.Claims.(jwt.MapClaims) iat := time.Now().Unix() cl...
[ "func", "(", "m", "*", "tokenManager", ")", "GenerateTransientUserAccessTokenForIdentity", "(", "ctx", "context", ".", "Context", ",", "identity", "repository", ".", "Identity", ")", "(", "*", "string", ",", "error", ")", "{", "token", ",", "err", ":=", "m",...
// GenerateTransientUserAccessTokenForIdentity generates a transient user access token, an extremely short-lived token
[ "GenerateTransientUserAccessTokenForIdentity", "generates", "a", "transient", "user", "access", "token", "an", "extremely", "short", "-", "lived", "token" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L519-L536
150,763
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
GenerateUnsignedUserAccessTokenForAPIClient
func (m *tokenManager) GenerateUnsignedUserAccessTokenForAPIClient(ctx context.Context, providerAccessToken string) (*jwt.Token, error) { kcClaims, err := m.ParseToken(ctx, providerAccessToken) if err != nil { return nil, errors.WithStack(err) } return m.GenerateUnsignedUserAccessTokenFromClaimsForAPIClient(ctx,...
go
func (m *tokenManager) GenerateUnsignedUserAccessTokenForAPIClient(ctx context.Context, providerAccessToken string) (*jwt.Token, error) { kcClaims, err := m.ParseToken(ctx, providerAccessToken) if err != nil { return nil, errors.WithStack(err) } return m.GenerateUnsignedUserAccessTokenFromClaimsForAPIClient(ctx,...
[ "func", "(", "m", "*", "tokenManager", ")", "GenerateUnsignedUserAccessTokenForAPIClient", "(", "ctx", "context", ".", "Context", ",", "providerAccessToken", "string", ")", "(", "*", "jwt", ".", "Token", ",", "error", ")", "{", "kcClaims", ",", "err", ":=", ...
// GenerateUnsignedUserAccessTokenForAPIClient generates an unsigned OAuth2 user access token for the api_client based on the Keycloak token
[ "GenerateUnsignedUserAccessTokenForAPIClient", "generates", "an", "unsigned", "OAuth2", "user", "access", "token", "for", "the", "api_client", "based", "on", "the", "Keycloak", "token" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L822-L829
150,764
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
GenerateUnsignedUserAccessTokenFromClaimsForAPIClient
func (m *tokenManager) GenerateUnsignedUserAccessTokenFromClaimsForAPIClient(ctx context.Context, tokenClaims *TokenClaims) (*jwt.Token, error) { token := jwt.New(jwt.SigningMethodRS256) token.Header["kid"] = m.userAccountPrivateKey.KeyID req := goa.ContextRequest(ctx) if req == nil { return nil, errors.New("mis...
go
func (m *tokenManager) GenerateUnsignedUserAccessTokenFromClaimsForAPIClient(ctx context.Context, tokenClaims *TokenClaims) (*jwt.Token, error) { token := jwt.New(jwt.SigningMethodRS256) token.Header["kid"] = m.userAccountPrivateKey.KeyID req := goa.ContextRequest(ctx) if req == nil { return nil, errors.New("mis...
[ "func", "(", "m", "*", "tokenManager", ")", "GenerateUnsignedUserAccessTokenFromClaimsForAPIClient", "(", "ctx", "context", ".", "Context", ",", "tokenClaims", "*", "TokenClaims", ")", "(", "*", "jwt", ".", "Token", ",", "error", ")", "{", "token", ":=", "jwt"...
// GenerateUnsignedUserAccessTokenFromClaimsForAPIClient generates a new token based on the specified claims for api_client
[ "GenerateUnsignedUserAccessTokenFromClaimsForAPIClient", "generates", "a", "new", "token", "based", "on", "the", "specified", "claims", "for", "api_client" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L832-L894
150,765
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
GenerateUnsignedUserRefreshTokenForAPIClient
func (m *tokenManager) GenerateUnsignedUserRefreshTokenForAPIClient(ctx context.Context, accessToken string) (*jwt.Token, error) { token := jwt.New(jwt.SigningMethodRS256) token.Header["kid"] = m.userAccountPrivateKey.KeyID tokenClaims, err := m.ParseToken(ctx, accessToken) if err != nil { return nil, errors.Wit...
go
func (m *tokenManager) GenerateUnsignedUserRefreshTokenForAPIClient(ctx context.Context, accessToken string) (*jwt.Token, error) { token := jwt.New(jwt.SigningMethodRS256) token.Header["kid"] = m.userAccountPrivateKey.KeyID tokenClaims, err := m.ParseToken(ctx, accessToken) if err != nil { return nil, errors.Wit...
[ "func", "(", "m", "*", "tokenManager", ")", "GenerateUnsignedUserRefreshTokenForAPIClient", "(", "ctx", "context", ".", "Context", ",", "accessToken", "string", ")", "(", "*", "jwt", ".", "Token", ",", "error", ")", "{", "token", ":=", "jwt", ".", "New", "...
// GenerateUnsignedUserRefreshToken generates an unsigned OAuth2 user refresh token for the given identity based on the Keycloak token
[ "GenerateUnsignedUserRefreshToken", "generates", "an", "unsigned", "OAuth2", "user", "refresh", "token", "for", "the", "given", "identity", "based", "on", "the", "Keycloak", "token" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L897-L944
150,766
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
Parse
func (m *tokenManager) Parse(ctx context.Context, tokenString string) (*jwt.Token, error) { keyFunc := m.KeyFunction(ctx) jwtToken, err := jwt.Parse(tokenString, keyFunc) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "unable to parse token") return nil, autherrors.NewUnauthorizedErro...
go
func (m *tokenManager) Parse(ctx context.Context, tokenString string) (*jwt.Token, error) { keyFunc := m.KeyFunction(ctx) jwtToken, err := jwt.Parse(tokenString, keyFunc) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "unable to parse token") return nil, autherrors.NewUnauthorizedErro...
[ "func", "(", "m", "*", "tokenManager", ")", "Parse", "(", "ctx", "context", ".", "Context", ",", "tokenString", "string", ")", "(", "*", "jwt", ".", "Token", ",", "error", ")", "{", "keyFunc", ":=", "m", ".", "KeyFunction", "(", "ctx", ")", "\n", "...
// Parse parses the specified token string and returns a JWT token
[ "Parse", "parses", "the", "specified", "token", "string", "and", "returns", "a", "JWT", "token" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L996-L1006
150,767
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
ParseToken
func (m *tokenManager) ParseToken(ctx context.Context, tokenString string) (*TokenClaims, error) { token, err := jwt.ParseWithClaims(tokenString, &TokenClaims{}, m.KeyFunction(ctx)) if err != nil { return nil, err } claims := token.Claims.(*TokenClaims) if token.Valid { return claims, nil } return nil, error...
go
func (m *tokenManager) ParseToken(ctx context.Context, tokenString string) (*TokenClaims, error) { token, err := jwt.ParseWithClaims(tokenString, &TokenClaims{}, m.KeyFunction(ctx)) if err != nil { return nil, err } claims := token.Claims.(*TokenClaims) if token.Valid { return claims, nil } return nil, error...
[ "func", "(", "m", "*", "tokenManager", ")", "ParseToken", "(", "ctx", "context", ".", "Context", ",", "tokenString", "string", ")", "(", "*", "TokenClaims", ",", "error", ")", "{", "token", ",", "err", ":=", "jwt", ".", "ParseWithClaims", "(", "tokenStri...
// ParseToken parses the specified token string and returns its claims
[ "ParseToken", "parses", "the", "specified", "token", "string", "and", "returns", "its", "claims" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L1009-L1019
150,768
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
ParseTokenWithMapClaims
func (m *tokenManager) ParseTokenWithMapClaims(ctx context.Context, tokenString string) (jwt.MapClaims, error) { token, err := jwt.Parse(tokenString, m.KeyFunction(ctx)) if err != nil { return nil, err } claims := token.Claims.(jwt.MapClaims) if token.Valid { return claims, nil } return nil, errors.WithStack...
go
func (m *tokenManager) ParseTokenWithMapClaims(ctx context.Context, tokenString string) (jwt.MapClaims, error) { token, err := jwt.Parse(tokenString, m.KeyFunction(ctx)) if err != nil { return nil, err } claims := token.Claims.(jwt.MapClaims) if token.Valid { return claims, nil } return nil, errors.WithStack...
[ "func", "(", "m", "*", "tokenManager", ")", "ParseTokenWithMapClaims", "(", "ctx", "context", ".", "Context", ",", "tokenString", "string", ")", "(", "jwt", ".", "MapClaims", ",", "error", ")", "{", "token", ",", "err", ":=", "jwt", ".", "Parse", "(", ...
// ParseTokenWithMapClaims parses token claims
[ "ParseTokenWithMapClaims", "parses", "token", "claims" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L1022-L1032
150,769
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
PublicKeys
func (m *tokenManager) PublicKeys() []*rsa.PublicKey { keys := make([]*rsa.PublicKey, 0, len(m.publicKeysMap)) for _, key := range m.publicKeys { keys = append(keys, key.Key) } return keys }
go
func (m *tokenManager) PublicKeys() []*rsa.PublicKey { keys := make([]*rsa.PublicKey, 0, len(m.publicKeysMap)) for _, key := range m.publicKeys { keys = append(keys, key.Key) } return keys }
[ "func", "(", "m", "*", "tokenManager", ")", "PublicKeys", "(", ")", "[", "]", "*", "rsa", ".", "PublicKey", "{", "keys", ":=", "make", "(", "[", "]", "*", "rsa", ".", "PublicKey", ",", "0", ",", "len", "(", "m", ".", "publicKeysMap", ")", ")", ...
// PublicKeys returns all the public keys
[ "PublicKeys", "returns", "all", "the", "public", "keys" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L1045-L1051
150,770
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
ConvertToken
func (m *tokenManager) ConvertToken(oauthToken oauth2.Token) (*TokenSet, error) { tokenSet := &TokenSet{ AccessToken: &oauthToken.AccessToken, RefreshToken: &oauthToken.RefreshToken, TokenType: &oauthToken.TokenType, } var err error tokenSet.ExpiresIn, err = m.extraInt(oauthToken, "expires_in") if err ...
go
func (m *tokenManager) ConvertToken(oauthToken oauth2.Token) (*TokenSet, error) { tokenSet := &TokenSet{ AccessToken: &oauthToken.AccessToken, RefreshToken: &oauthToken.RefreshToken, TokenType: &oauthToken.TokenType, } var err error tokenSet.ExpiresIn, err = m.extraInt(oauthToken, "expires_in") if err ...
[ "func", "(", "m", "*", "tokenManager", ")", "ConvertToken", "(", "oauthToken", "oauth2", ".", "Token", ")", "(", "*", "TokenSet", ",", "error", ")", "{", "tokenSet", ":=", "&", "TokenSet", "{", "AccessToken", ":", "&", "oauthToken", ".", "AccessToken", "...
// ConvertToken converts the oauth2.Token to a token set
[ "ConvertToken", "converts", "the", "oauth2", ".", "Token", "to", "a", "token", "set" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L1054-L1077
150,771
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
ConvertTokenSet
func (m *tokenManager) ConvertTokenSet(tokenSet TokenSet) *oauth2.Token { var accessToken, refreshToken, tokenType string extra := make(map[string]interface{}) if tokenSet.AccessToken != nil { accessToken = *tokenSet.AccessToken } if tokenSet.RefreshToken != nil { refreshToken = *tokenSet.RefreshToken } if t...
go
func (m *tokenManager) ConvertTokenSet(tokenSet TokenSet) *oauth2.Token { var accessToken, refreshToken, tokenType string extra := make(map[string]interface{}) if tokenSet.AccessToken != nil { accessToken = *tokenSet.AccessToken } if tokenSet.RefreshToken != nil { refreshToken = *tokenSet.RefreshToken } if t...
[ "func", "(", "m", "*", "tokenManager", ")", "ConvertTokenSet", "(", "tokenSet", "TokenSet", ")", "*", "oauth2", ".", "Token", "{", "var", "accessToken", ",", "refreshToken", ",", "tokenType", "string", "\n", "extra", ":=", "make", "(", "map", "[", "string"...
// ConvertTokenSet converts the token set to oauth2.Token
[ "ConvertTokenSet", "converts", "the", "token", "set", "to", "oauth2", ".", "Token" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L1080-L1113
150,772
fabric8-services/fabric8-auth
authorization/token/manager/token_manager.go
loadPrivateKey
func (m *tokenManager) loadPrivateKey(tm *tokenManager, key []byte, kid string, deprecatedKey []byte, deprecatedKid string) (*token.PrivateKey, error) { if len(key) == 0 || kid == "" { log.Error(nil, map[string]interface{}{ "kid": kid, "key_length": len(key), }, "private key or its ID are not set up")...
go
func (m *tokenManager) loadPrivateKey(tm *tokenManager, key []byte, kid string, deprecatedKey []byte, deprecatedKid string) (*token.PrivateKey, error) { if len(key) == 0 || kid == "" { log.Error(nil, map[string]interface{}{ "kid": kid, "key_length": len(key), }, "private key or its ID are not set up")...
[ "func", "(", "m", "*", "tokenManager", ")", "loadPrivateKey", "(", "tm", "*", "tokenManager", ",", "key", "[", "]", "byte", ",", "kid", "string", ",", "deprecatedKey", "[", "]", "byte", ",", "deprecatedKid", "string", ")", "(", "*", "token", ".", "Priv...
// LoadPrivateKey loads a private key and a deprecated private key. // Extracts public keys from them and adds them to the manager // Returns the loaded private key.
[ "LoadPrivateKey", "loads", "a", "private", "key", "and", "a", "deprecated", "private", "key", ".", "Extracts", "public", "keys", "from", "them", "and", "adds", "them", "to", "the", "manager", "Returns", "the", "loaded", "private", "key", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/token/manager/token_manager.go#L1152-L1191
150,773
fabric8-services/fabric8-auth
cluster/factory/cluster_cache_factory.go
NewClusterCacheFactory
func NewClusterCacheFactory(context servicecontext.ServiceContext, config ClusterCacheFactoryConfiguration) service.ClusterCacheFactory { factory := &clusterCacheFactoryImpl{ BaseService: base.NewBaseService(context), config: config, } return factory }
go
func NewClusterCacheFactory(context servicecontext.ServiceContext, config ClusterCacheFactoryConfiguration) service.ClusterCacheFactory { factory := &clusterCacheFactoryImpl{ BaseService: base.NewBaseService(context), config: config, } return factory }
[ "func", "NewClusterCacheFactory", "(", "context", "servicecontext", ".", "ServiceContext", ",", "config", "ClusterCacheFactoryConfiguration", ")", "service", ".", "ClusterCacheFactory", "{", "factory", ":=", "&", "clusterCacheFactoryImpl", "{", "BaseService", ":", "base",...
// NewClusterCacheFactory returns the default cluster cache factory.
[ "NewClusterCacheFactory", "returns", "the", "default", "cluster", "cache", "factory", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/cluster/factory/cluster_cache_factory.go#L23-L29
150,774
fabric8-services/fabric8-auth
cluster/factory/cluster_cache_factory.go
NewClusterCache
func (f *clusterCacheFactoryImpl) NewClusterCache(ctx context.Context, options ...rest.HTTPClientOption) cluster.ClusterCache { return clusterservice.NewCache(f.config, options...) }
go
func (f *clusterCacheFactoryImpl) NewClusterCache(ctx context.Context, options ...rest.HTTPClientOption) cluster.ClusterCache { return clusterservice.NewCache(f.config, options...) }
[ "func", "(", "f", "*", "clusterCacheFactoryImpl", ")", "NewClusterCache", "(", "ctx", "context", ".", "Context", ",", "options", "...", "rest", ".", "HTTPClientOption", ")", "cluster", ".", "ClusterCache", "{", "return", "clusterservice", ".", "NewCache", "(", ...
// NewClusterCache creates a new cluster cache
[ "NewClusterCache", "creates", "a", "new", "cluster", "cache" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/cluster/factory/cluster_cache_factory.go#L37-L39
150,775
fabric8-services/fabric8-auth
authentication/provider/service/authentication_provider_service.go
NewAuthenticationProviderService
func NewAuthenticationProviderService(ctx servicecontext.ServiceContext, config AuthenticationProviderServiceConfig) service.AuthenticationProviderService { return &authenticationProviderServiceImpl{ BaseService: base.NewBaseService(ctx), config: config, } }
go
func NewAuthenticationProviderService(ctx servicecontext.ServiceContext, config AuthenticationProviderServiceConfig) service.AuthenticationProviderService { return &authenticationProviderServiceImpl{ BaseService: base.NewBaseService(ctx), config: config, } }
[ "func", "NewAuthenticationProviderService", "(", "ctx", "servicecontext", ".", "ServiceContext", ",", "config", "AuthenticationProviderServiceConfig", ")", "service", ".", "AuthenticationProviderService", "{", "return", "&", "authenticationProviderServiceImpl", "{", "BaseServic...
// NewAuthenticationProviderService returns a new AuthenticationProviderService implementation
[ "NewAuthenticationProviderService", "returns", "a", "new", "AuthenticationProviderService", "implementation" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/authentication_provider_service.go#L53-L58
150,776
fabric8-services/fabric8-auth
authentication/provider/service/authentication_provider_service.go
LoginCallback
func (s *authenticationProviderServiceImpl) LoginCallback(ctx context.Context, state string, code string, redirectURL string) (*string, error) { // After redirect from oauth provider log.Debug(ctx, map[string]interface{}{ "code": code, "state": state, }, "Redirected from oauth provider") referrerURL, _, err ...
go
func (s *authenticationProviderServiceImpl) LoginCallback(ctx context.Context, state string, code string, redirectURL string) (*string, error) { // After redirect from oauth provider log.Debug(ctx, map[string]interface{}{ "code": code, "state": state, }, "Redirected from oauth provider") referrerURL, _, err ...
[ "func", "(", "s", "*", "authenticationProviderServiceImpl", ")", "LoginCallback", "(", "ctx", "context", ".", "Context", ",", "state", "string", ",", "code", "string", ",", "redirectURL", "string", ")", "(", "*", "string", ",", "error", ")", "{", "// After r...
// LoginCallback is invoked after the client has visited the authentication provider and state and code values are returned. // These two parameters will be exchanged with the authentication provider for an access token, which will then be // returned to the client.
[ "LoginCallback", "is", "invoked", "after", "the", "client", "has", "visited", "the", "authentication", "provider", "and", "state", "and", "code", "values", "are", "returned", ".", "These", "two", "parameters", "will", "be", "exchanged", "with", "the", "authentic...
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/authentication_provider_service.go#L121-L151
150,777
fabric8-services/fabric8-auth
authentication/provider/service/authentication_provider_service.go
ExchangeCodeWithProvider
func (s *authenticationProviderServiceImpl) ExchangeCodeWithProvider(ctx context.Context, code string, redirectURL string) (*oauth2.Token, error) { // Exchange the code for an access token provider := s.Factories().IdentityProviderFactory().NewIdentityProvider(ctx, s.config) provider.SetRedirectURL(redirectURL) to...
go
func (s *authenticationProviderServiceImpl) ExchangeCodeWithProvider(ctx context.Context, code string, redirectURL string) (*oauth2.Token, error) { // Exchange the code for an access token provider := s.Factories().IdentityProviderFactory().NewIdentityProvider(ctx, s.config) provider.SetRedirectURL(redirectURL) to...
[ "func", "(", "s", "*", "authenticationProviderServiceImpl", ")", "ExchangeCodeWithProvider", "(", "ctx", "context", ".", "Context", ",", "code", "string", ",", "redirectURL", "string", ")", "(", "*", "oauth2", ".", "Token", ",", "error", ")", "{", "// Exchange...
// Exchange exchanges the given code for OAuth2 token with the Authentication provider
[ "Exchange", "exchanges", "the", "given", "code", "for", "OAuth2", "token", "with", "the", "Authentication", "provider" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/authentication_provider_service.go#L234-L254
150,778
fabric8-services/fabric8-auth
authentication/provider/service/authentication_provider_service.go
UpdateIdentityUsingUserInfoEndPoint
func (s *authenticationProviderServiceImpl) UpdateIdentityUsingUserInfoEndPoint(ctx context.Context, accessToken string) (*account.Identity, error) { userProfile, err := s.Factories().IdentityProviderFactory().NewIdentityProvider(ctx, s.config).Profile(ctx, oauth2.Token{AccessToken: accessToken}) if err != nil { l...
go
func (s *authenticationProviderServiceImpl) UpdateIdentityUsingUserInfoEndPoint(ctx context.Context, accessToken string) (*account.Identity, error) { userProfile, err := s.Factories().IdentityProviderFactory().NewIdentityProvider(ctx, s.config).Profile(ctx, oauth2.Token{AccessToken: accessToken}) if err != nil { l...
[ "func", "(", "s", "*", "authenticationProviderServiceImpl", ")", "UpdateIdentityUsingUserInfoEndPoint", "(", "ctx", "context", ".", "Context", ",", "accessToken", "string", ")", "(", "*", "account", ".", "Identity", ",", "error", ")", "{", "userProfile", ",", "e...
// UpdateIdentityFromExistingIdentityInfo update identity if exists using profile information and returns updated identity.
[ "UpdateIdentityFromExistingIdentityInfo", "update", "identity", "if", "exists", "using", "profile", "information", "and", "returns", "updated", "identity", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/authentication_provider_service.go#L378-L441
150,779
fabric8-services/fabric8-auth
authentication/provider/service/authentication_provider_service.go
SaveReferrer
func (s *authenticationProviderServiceImpl) SaveReferrer(ctx context.Context, state string, referrer string, responseMode *string, validReferrerURL string) error { matched, err := regexp.MatchString(validReferrerURL, referrer) if err != nil { log.Error(ctx, map[string]interface{}{ "referrer": referre...
go
func (s *authenticationProviderServiceImpl) SaveReferrer(ctx context.Context, state string, referrer string, responseMode *string, validReferrerURL string) error { matched, err := regexp.MatchString(validReferrerURL, referrer) if err != nil { log.Error(ctx, map[string]interface{}{ "referrer": referre...
[ "func", "(", "s", "*", "authenticationProviderServiceImpl", ")", "SaveReferrer", "(", "ctx", "context", ".", "Context", ",", "state", "string", ",", "referrer", "string", ",", "responseMode", "*", "string", ",", "validReferrerURL", "string", ")", "error", "{", ...
// SaveReferrer validates referrer and saves it in DB
[ "SaveReferrer", "validates", "referrer", "and", "saves", "it", "in", "DB" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/authentication_provider_service.go#L466-L508
150,780
fabric8-services/fabric8-auth
authentication/provider/service/authentication_provider_service.go
LoadReferrerAndResponseMode
func (s *authenticationProviderServiceImpl) LoadReferrerAndResponseMode(ctx context.Context, state string) (string, *string, error) { var referrer string var responseMode *string err := s.ExecuteInTransaction(func() error { ref, err := s.Repositories().OauthStates().Load(ctx, state) if err != nil { log.Error...
go
func (s *authenticationProviderServiceImpl) LoadReferrerAndResponseMode(ctx context.Context, state string) (string, *string, error) { var referrer string var responseMode *string err := s.ExecuteInTransaction(func() error { ref, err := s.Repositories().OauthStates().Load(ctx, state) if err != nil { log.Error...
[ "func", "(", "s", "*", "authenticationProviderServiceImpl", ")", "LoadReferrerAndResponseMode", "(", "ctx", "context", ".", "Context", ",", "state", "string", ")", "(", "string", ",", "*", "string", ",", "error", ")", "{", "var", "referrer", "string", "\n", ...
// LoadReferrerAndResponseMode loads referrer and responseMode from DB
[ "LoadReferrerAndResponseMode", "loads", "referrer", "and", "responseMode", "from", "DB" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/authentication_provider_service.go#L511-L541
150,781
fabric8-services/fabric8-auth
authentication/provider/service/authentication_provider_service.go
reclaimReferrerAndResponseMode
func (s *authenticationProviderServiceImpl) reclaimReferrerAndResponseMode(ctx context.Context, state string, code string) (*url.URL, *string, error) { knownReferrer, responseMode, err := s.LoadReferrerAndResponseMode(ctx, state) if err != nil { log.Error(ctx, map[string]interface{}{ "state": state, "err": ...
go
func (s *authenticationProviderServiceImpl) reclaimReferrerAndResponseMode(ctx context.Context, state string, code string) (*url.URL, *string, error) { knownReferrer, responseMode, err := s.LoadReferrerAndResponseMode(ctx, state) if err != nil { log.Error(ctx, map[string]interface{}{ "state": state, "err": ...
[ "func", "(", "s", "*", "authenticationProviderServiceImpl", ")", "reclaimReferrerAndResponseMode", "(", "ctx", "context", ".", "Context", ",", "state", "string", ",", "code", "string", ")", "(", "*", "url", ".", "URL", ",", "*", "string", ",", "error", ")", ...
// reclaimReferrer reclaims referrerURL and verifies the state
[ "reclaimReferrer", "reclaims", "referrerURL", "and", "verifies", "the", "state" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/authentication_provider_service.go#L544-L572
150,782
fabric8-services/fabric8-auth
authentication/provider/service/authentication_provider_service.go
TokenToJSON
func TokenToJSON(ctx context.Context, outhToken *oauth2.Token) (string, error) { str := outhToken.Extra("expires_in") var expiresIn interface{} var refreshExpiresIn interface{} var err error expiresIn, err = manager.NumberToInt(str) if err != nil { log.Error(ctx, map[string]interface{}{ "expires_in": str, ...
go
func TokenToJSON(ctx context.Context, outhToken *oauth2.Token) (string, error) { str := outhToken.Extra("expires_in") var expiresIn interface{} var refreshExpiresIn interface{} var err error expiresIn, err = manager.NumberToInt(str) if err != nil { log.Error(ctx, map[string]interface{}{ "expires_in": str, ...
[ "func", "TokenToJSON", "(", "ctx", "context", ".", "Context", ",", "outhToken", "*", "oauth2", ".", "Token", ")", "(", "string", ",", "error", ")", "{", "str", ":=", "outhToken", ".", "Extra", "(", "\"", "\"", ")", "\n", "var", "expiresIn", "interface"...
// TokenToJSON marshals an oauth2 token to a json string
[ "TokenToJSON", "marshals", "an", "oauth2", "token", "to", "a", "json", "string" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/authentication_provider_service.go#L592-L627
150,783
fabric8-services/fabric8-auth
authorization/resource/repository/resource.go
NewResourceRepository
func NewResourceRepository(db *gorm.DB) ResourceRepository { return &GormResourceRepository{db: db, resourceTypeRepo: resourcetype.NewResourceTypeRepository(db)} }
go
func NewResourceRepository(db *gorm.DB) ResourceRepository { return &GormResourceRepository{db: db, resourceTypeRepo: resourcetype.NewResourceTypeRepository(db)} }
[ "func", "NewResourceRepository", "(", "db", "*", "gorm", ".", "DB", ")", "ResourceRepository", "{", "return", "&", "GormResourceRepository", "{", "db", ":", "db", ",", "resourceTypeRepo", ":", "resourcetype", ".", "NewResourceTypeRepository", "(", "db", ")", "}"...
// NewResourceRepository creates a new storage type.
[ "NewResourceRepository", "creates", "a", "new", "storage", "type", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/resource/repository/resource.go#L55-L57
150,784
fabric8-services/fabric8-auth
authorization/resource/repository/resource.go
LoadChildren
func (m *GormResourceRepository) LoadChildren(ctx context.Context, id string) ([]Resource, error) { defer goa.MeasureSince([]string{"goa", "db", "resource", "loadChildren"}, time.Now()) var rows []Resource err := m.db.Model(&Resource{}).Preload("ResourceType").Where("parent_resource_id = ?", id).Find(&rows).Error ...
go
func (m *GormResourceRepository) LoadChildren(ctx context.Context, id string) ([]Resource, error) { defer goa.MeasureSince([]string{"goa", "db", "resource", "loadChildren"}, time.Now()) var rows []Resource err := m.db.Model(&Resource{}).Preload("ResourceType").Where("parent_resource_id = ?", id).Find(&rows).Error ...
[ "func", "(", "m", "*", "GormResourceRepository", ")", "LoadChildren", "(", "ctx", "context", ".", "Context", ",", "id", "string", ")", "(", "[", "]", "Resource", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", "{",...
// LoadChildren returns direct children resources of the given resource or an empty array if no children found
[ "LoadChildren", "returns", "direct", "children", "resources", "of", "the", "given", "resource", "or", "an", "empty", "array", "if", "no", "children", "found" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/resource/repository/resource.go#L92-L101
150,785
fabric8-services/fabric8-auth
controller/team.go
NewTeamController
func NewTeamController(service *goa.Service, app application.Application) *TeamController { return &TeamController{Controller: service.NewController("TeamController"), app: app} }
go
func NewTeamController(service *goa.Service, app application.Application) *TeamController { return &TeamController{Controller: service.NewController("TeamController"), app: app} }
[ "func", "NewTeamController", "(", "service", "*", "goa", ".", "Service", ",", "app", "application", ".", "Application", ")", "*", "TeamController", "{", "return", "&", "TeamController", "{", "Controller", ":", "service", ".", "NewController", "(", "\"", "\"", ...
// NewTeamController creates a team controller.
[ "NewTeamController", "creates", "a", "team", "controller", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/team.go#L23-L25
150,786
fabric8-services/fabric8-auth
controller/resource.go
NewResourceController
func NewResourceController(service *goa.Service, app application.Application) *ResourceController { return &ResourceController{Controller: service.NewController("ResourceController"), app: app} }
go
func NewResourceController(service *goa.Service, app application.Application) *ResourceController { return &ResourceController{Controller: service.NewController("ResourceController"), app: app} }
[ "func", "NewResourceController", "(", "service", "*", "goa", ".", "Service", ",", "app", "application", ".", "Application", ")", "*", "ResourceController", "{", "return", "&", "ResourceController", "{", "Controller", ":", "service", ".", "NewController", "(", "\...
// NewResourceController creates a resource controller.
[ "NewResourceController", "creates", "a", "resource", "controller", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/resource.go#L23-L25
150,787
fabric8-services/fabric8-auth
controller/resource.go
Show
func (c *ResourceController) Show(ctx *app.ShowResourceContext) error { if !token.IsServiceAccount(ctx) { log.Error(ctx, map[string]interface{}{}, "Unable to read resource. Not a service account") return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("not a service account")) } svc := c.app.Resourc...
go
func (c *ResourceController) Show(ctx *app.ShowResourceContext) error { if !token.IsServiceAccount(ctx) { log.Error(ctx, map[string]interface{}{}, "Unable to read resource. Not a service account") return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("not a service account")) } svc := c.app.Resourc...
[ "func", "(", "c", "*", "ResourceController", ")", "Show", "(", "ctx", "*", "app", ".", "ShowResourceContext", ")", "error", "{", "if", "!", "token", ".", "IsServiceAccount", "(", "ctx", ")", "{", "log", ".", "Error", "(", "ctx", ",", "map", "[", "str...
// Show runs the "Show" action.
[ "Show", "runs", "the", "Show", "action", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/resource.go#L47-L64
150,788
fabric8-services/fabric8-auth
controller/resource.go
Register
func (c *ResourceController) Register(ctx *app.RegisterResourceContext) error { if !token.IsServiceAccount(ctx) { log.Error(ctx, map[string]interface{}{}, "Unable to register resource. Not a service account") return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("not a service account")) } var mana...
go
func (c *ResourceController) Register(ctx *app.RegisterResourceContext) error { if !token.IsServiceAccount(ctx) { log.Error(ctx, map[string]interface{}{}, "Unable to register resource. Not a service account") return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("not a service account")) } var mana...
[ "func", "(", "c", "*", "ResourceController", ")", "Register", "(", "ctx", "*", "app", ".", "RegisterResourceContext", ")", "error", "{", "if", "!", "token", ".", "IsServiceAccount", "(", "ctx", ")", "{", "log", ".", "Error", "(", "ctx", ",", "map", "["...
// Register runs the register action.
[ "Register", "runs", "the", "register", "action", "." ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/resource.go#L67-L93
150,789
fabric8-services/fabric8-auth
controller/resource.go
Scopes
func (c *ResourceController) Scopes(ctx *app.ScopesResourceContext) error { // Load the identity from the context currentIdentity, err := c.app.UserService().LoadContextIdentityIfNotBanned(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } // Check if the resource exists err = c.app.ResourceRepo...
go
func (c *ResourceController) Scopes(ctx *app.ScopesResourceContext) error { // Load the identity from the context currentIdentity, err := c.app.UserService().LoadContextIdentityIfNotBanned(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } // Check if the resource exists err = c.app.ResourceRepo...
[ "func", "(", "c", "*", "ResourceController", ")", "Scopes", "(", "ctx", "*", "app", ".", "ScopesResourceContext", ")", "error", "{", "// Load the identity from the context", "currentIdentity", ",", "err", ":=", "c", ".", "app", ".", "UserService", "(", ")", "....
// Scopes runs the scopes action, which returns the available scopes for the specified resource
[ "Scopes", "runs", "the", "scopes", "action", "which", "returns", "the", "available", "scopes", "for", "the", "specified", "resource" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/controller/resource.go#L96-L129
150,790
fabric8-services/fabric8-auth
authentication/provider/service/user_profile_service.go
NewUserProfileService
func NewUserProfileService(context servicecontext.ServiceContext) service.UserProfileService { return &userProfileService{ client: http.DefaultClient, } }
go
func NewUserProfileService(context servicecontext.ServiceContext) service.UserProfileService { return &userProfileService{ client: http.DefaultClient, } }
[ "func", "NewUserProfileService", "(", "context", "servicecontext", ".", "ServiceContext", ")", "service", ".", "UserProfileService", "{", "return", "&", "userProfileService", "{", "client", ":", "http", ".", "DefaultClient", ",", "}", "\n", "}" ]
// NewUserProfileService creates a new UserProfileService
[ "NewUserProfileService", "creates", "a", "new", "UserProfileService" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/user_profile_service.go#L27-L31
150,791
fabric8-services/fabric8-auth
authentication/provider/service/user_profile_service.go
Get
func (s *userProfileService) Get(ctx context.Context, accessToken string, profileURL string) (*provider.OAuthUserProfileResponse, error) { userProfileResponse := provider.OAuthUserProfileResponse{} req, err := http.NewRequest("GET", profileURL, nil) if err != nil { return nil, errors.NewInternalError(ctx, err) ...
go
func (s *userProfileService) Get(ctx context.Context, accessToken string, profileURL string) (*provider.OAuthUserProfileResponse, error) { userProfileResponse := provider.OAuthUserProfileResponse{} req, err := http.NewRequest("GET", profileURL, nil) if err != nil { return nil, errors.NewInternalError(ctx, err) ...
[ "func", "(", "s", "*", "userProfileService", ")", "Get", "(", "ctx", "context", ".", "Context", ",", "accessToken", "string", ",", "profileURL", "string", ")", "(", "*", "provider", ".", "OAuthUserProfileResponse", ",", "error", ")", "{", "userProfileResponse"...
//Get gets the user profile information from Oauth provider
[ "Get", "gets", "the", "user", "profile", "information", "from", "Oauth", "provider" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authentication/provider/service/user_profile_service.go#L34-L73
150,792
fabric8-services/fabric8-auth
authorization/role/repository/identity_role.go
List
func (m *GormIdentityRoleRepository) List(ctx context.Context) ([]IdentityRole, error) { defer goa.MeasureSince([]string{"goa", "db", "identity_role", "list"}, time.Now()) var rows []IdentityRole err := m.db.Model(&resourcetype.ResourceType{}).Find(&rows).Error if err != nil && err != gorm.ErrRecordNotFound { re...
go
func (m *GormIdentityRoleRepository) List(ctx context.Context) ([]IdentityRole, error) { defer goa.MeasureSince([]string{"goa", "db", "identity_role", "list"}, time.Now()) var rows []IdentityRole err := m.db.Model(&resourcetype.ResourceType{}).Find(&rows).Error if err != nil && err != gorm.ErrRecordNotFound { re...
[ "func", "(", "m", "*", "GormIdentityRoleRepository", ")", "List", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "IdentityRole", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", "{", "\"", "\"", ",", "...
// List returns all identity roles
[ "List", "returns", "all", "identity", "roles" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/repository/identity_role.go#L217-L226
150,793
fabric8-services/fabric8-auth
authorization/role/repository/identity_role.go
FindPermissions
func (m *GormIdentityRoleRepository) FindPermissions(ctx context.Context, identityID uuid.UUID, resourceID string, scopeName string) ([]IdentityRole, error) { var results []IdentityRole err := m.db.Table(m.TableName()).Where(`deleted_at IS NULL AND identity_id IN ( SELECT id FROM identities i WHERE ...
go
func (m *GormIdentityRoleRepository) FindPermissions(ctx context.Context, identityID uuid.UUID, resourceID string, scopeName string) ([]IdentityRole, error) { var results []IdentityRole err := m.db.Table(m.TableName()).Where(`deleted_at IS NULL AND identity_id IN ( SELECT id FROM identities i WHERE ...
[ "func", "(", "m", "*", "GormIdentityRoleRepository", ")", "FindPermissions", "(", "ctx", "context", ".", "Context", ",", "identityID", "uuid", ".", "UUID", ",", "resourceID", "string", ",", "scopeName", "string", ")", "(", "[", "]", "IdentityRole", ",", "err...
// FindPermissions returns an IdentityRole array containing entries that match the specified identity, resource and scope
[ "FindPermissions", "returns", "an", "IdentityRole", "array", "containing", "entries", "that", "match", "the", "specified", "identity", "resource", "and", "scope" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/repository/identity_role.go#L229-L371
150,794
fabric8-services/fabric8-auth
authorization/role/repository/identity_role.go
FindIdentityRolesForIdentity
func (m *GormIdentityRoleRepository) FindIdentityRolesForIdentity(ctx context.Context, identityID uuid.UUID, resourceType *string) ([]authorization.IdentityAssociation, error) { defer goa.MeasureSince([]string{"goa", "db", "identity_role", "FindIdentityRolesForIdentity"}, time.Now()) associations := []authorization.I...
go
func (m *GormIdentityRoleRepository) FindIdentityRolesForIdentity(ctx context.Context, identityID uuid.UUID, resourceType *string) ([]authorization.IdentityAssociation, error) { defer goa.MeasureSince([]string{"goa", "db", "identity_role", "FindIdentityRolesForIdentity"}, time.Now()) associations := []authorization.I...
[ "func", "(", "m", "*", "GormIdentityRoleRepository", ")", "FindIdentityRolesForIdentity", "(", "ctx", "context", ".", "Context", ",", "identityID", "uuid", ".", "UUID", ",", "resourceType", "*", "string", ")", "(", "[", "]", "authorization", ".", "IdentityAssoci...
// FindIdentityRolesForIdentity returns an IdentityAssociations describing the roles which the specified Identity has, optionally for a specified resource type
[ "FindIdentityRolesForIdentity", "returns", "an", "IdentityAssociations", "describing", "the", "roles", "which", "the", "specified", "Identity", "has", "optionally", "for", "a", "specified", "resource", "type" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/repository/identity_role.go#L374-L413
150,795
fabric8-services/fabric8-auth
authorization/role/repository/identity_role.go
FindIdentityRolesByResourceAndRoleName
func (m *GormIdentityRoleRepository) FindIdentityRolesByResourceAndRoleName(ctx context.Context, resourceID string, roleName string, includeParenResources bool) ([]IdentityRole, error) { if includeParenResources { return m.findIdentityRolesByResourceAndRoleNameWithParents(ctx, resourceID, roleName) } return m.find...
go
func (m *GormIdentityRoleRepository) FindIdentityRolesByResourceAndRoleName(ctx context.Context, resourceID string, roleName string, includeParenResources bool) ([]IdentityRole, error) { if includeParenResources { return m.findIdentityRolesByResourceAndRoleNameWithParents(ctx, resourceID, roleName) } return m.find...
[ "func", "(", "m", "*", "GormIdentityRoleRepository", ")", "FindIdentityRolesByResourceAndRoleName", "(", "ctx", "context", ".", "Context", ",", "resourceID", "string", ",", "roleName", "string", ",", "includeParenResources", "bool", ")", "(", "[", "]", "IdentityRole...
// FindIdentityRolesByResourceAndRoleName returns an array of IdentityRole objects that match the specified resource and role name
[ "FindIdentityRolesByResourceAndRoleName", "returns", "an", "array", "of", "IdentityRole", "objects", "that", "match", "the", "specified", "resource", "and", "role", "name" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/repository/identity_role.go#L416-L421
150,796
fabric8-services/fabric8-auth
authorization/role/repository/identity_role.go
FindIdentityRolesByResource
func (m *GormIdentityRoleRepository) FindIdentityRolesByResource(ctx context.Context, resourceID string, includeParenResources bool) ([]IdentityRole, error) { if includeParenResources { return m.findIdentityRolesByResourceWithParents(ctx, resourceID) } return m.findIdentityRolesByResource(ctx, resourceID) }
go
func (m *GormIdentityRoleRepository) FindIdentityRolesByResource(ctx context.Context, resourceID string, includeParenResources bool) ([]IdentityRole, error) { if includeParenResources { return m.findIdentityRolesByResourceWithParents(ctx, resourceID) } return m.findIdentityRolesByResource(ctx, resourceID) }
[ "func", "(", "m", "*", "GormIdentityRoleRepository", ")", "FindIdentityRolesByResource", "(", "ctx", "context", ".", "Context", ",", "resourceID", "string", ",", "includeParenResources", "bool", ")", "(", "[", "]", "IdentityRole", ",", "error", ")", "{", "if", ...
// FindIdentityRolesByResource returns an array of IdentityRole for the specified resource
[ "FindIdentityRolesByResource", "returns", "an", "array", "of", "IdentityRole", "for", "the", "specified", "resource" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/repository/identity_role.go#L451-L456
150,797
fabric8-services/fabric8-auth
authorization/role/repository/identity_role.go
DeleteForIdentityAndResource
func (m *GormIdentityRoleRepository) DeleteForIdentityAndResource(ctx context.Context, resourceID string, identityID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "identity_role", "deleteForIdentityAndResource"}, time.Now()) result := m.db.Scopes(identityRoleFilterByIdentityID(identityID), identityR...
go
func (m *GormIdentityRoleRepository) DeleteForIdentityAndResource(ctx context.Context, resourceID string, identityID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "identity_role", "deleteForIdentityAndResource"}, time.Now()) result := m.db.Scopes(identityRoleFilterByIdentityID(identityID), identityR...
[ "func", "(", "m", "*", "GormIdentityRoleRepository", ")", "DeleteForIdentityAndResource", "(", "ctx", "context", ".", "Context", ",", "resourceID", "string", ",", "identityID", "uuid", ".", "UUID", ")", "error", "{", "defer", "goa", ".", "MeasureSince", "(", "...
// DeleteForIdentityAndResource deletes all IdentityRoles for the specified identity and resource // NotFoundError returned if no identity roles found to delete
[ "DeleteForIdentityAndResource", "deletes", "all", "IdentityRoles", "for", "the", "specified", "identity", "and", "resource", "NotFoundError", "returned", "if", "no", "identity", "roles", "found", "to", "delete" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/repository/identity_role.go#L498-L513
150,798
fabric8-services/fabric8-auth
authorization/role/repository/identity_role.go
FindIdentityRolesByIdentityAndResource
func (m *GormIdentityRoleRepository) FindIdentityRolesByIdentityAndResource(ctx context.Context, resourceID string, identityID uuid.UUID) ([]IdentityRole, error) { return m.query(identityRoleFilterByIdentityID(identityID), identityRoleFilterByResource(resourceID)) }
go
func (m *GormIdentityRoleRepository) FindIdentityRolesByIdentityAndResource(ctx context.Context, resourceID string, identityID uuid.UUID) ([]IdentityRole, error) { return m.query(identityRoleFilterByIdentityID(identityID), identityRoleFilterByResource(resourceID)) }
[ "func", "(", "m", "*", "GormIdentityRoleRepository", ")", "FindIdentityRolesByIdentityAndResource", "(", "ctx", "context", ".", "Context", ",", "resourceID", "string", ",", "identityID", "uuid", ".", "UUID", ")", "(", "[", "]", "IdentityRole", ",", "error", ")",...
// FindIdentityRolesByIdentityAndResource returns all identity roles by identity ID and resource ID
[ "FindIdentityRolesByIdentityAndResource", "returns", "all", "identity", "roles", "by", "identity", "ID", "and", "resource", "ID" ]
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/repository/identity_role.go#L516-L518
150,799
fabric8-services/fabric8-auth
authorization/role/repository/identity_role.go
FindScopesByIdentityAndResource
func (m *GormIdentityRoleRepository) FindScopesByIdentityAndResource(ctx context.Context, identityID uuid.UUID, resourceID string) ([]string, error) { type Result struct { Scope string } var results []Result err := m.db.Raw(`WITH identity_resource_roles AS ( WITH identity_hierarchy AS ( WITH RECURSIVE m AS ...
go
func (m *GormIdentityRoleRepository) FindScopesByIdentityAndResource(ctx context.Context, identityID uuid.UUID, resourceID string) ([]string, error) { type Result struct { Scope string } var results []Result err := m.db.Raw(`WITH identity_resource_roles AS ( WITH identity_hierarchy AS ( WITH RECURSIVE m AS ...
[ "func", "(", "m", "*", "GormIdentityRoleRepository", ")", "FindScopesByIdentityAndResource", "(", "ctx", "context", ".", "Context", ",", "identityID", "uuid", ".", "UUID", ",", "resourceID", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "ty...
// FindScopesByIdentityAndResource returns all scopes for the specified identity and resource, both assigned directly and // also those indirectly inherited via memberships, resource hierarchy and role mappings.
[ "FindScopesByIdentityAndResource", "returns", "all", "scopes", "for", "the", "specified", "identity", "and", "resource", "both", "assigned", "directly", "and", "also", "those", "indirectly", "inherited", "via", "memberships", "resource", "hierarchy", "and", "role", "m...
2a60f45fcdf7456553025afca28e81115285cce6
https://github.com/fabric8-services/fabric8-auth/blob/2a60f45fcdf7456553025afca28e81115285cce6/authorization/role/repository/identity_role.go#L522-L670