mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-27 04:35:16 +01:00
update
This commit is contained in:
parent
d2eb8fc8b6
commit
aac742e8ba
@ -112,13 +112,13 @@ func (a *AuthContext) GetMyProjects() []string {
|
||||
return projects
|
||||
}
|
||||
|
||||
// GetAuthCtxOfCurrentUser returns the auth context of the current user
|
||||
func GetAuthCtxOfCurrentUser(client *http.Client, url, token string) (*AuthContext, error) {
|
||||
// GetAuthCtx returns the auth context of the current user
|
||||
func GetAuthCtx(client *http.Client, url, token string) (*AuthContext, error) {
|
||||
return get(client, url, token)
|
||||
}
|
||||
|
||||
// GetAuthCtxOfSpecificUser returns the auth context of the specific user
|
||||
func GetAuthCtxOfSpecificUser(client *http.Client, url, token string, username string) (*AuthContext, error) {
|
||||
// GetAuthCtxOfUser returns the auth context of the specific user
|
||||
func GetAuthCtxOfUser(client *http.Client, url, token string, username string) (*AuthContext, error) {
|
||||
return get(client, url, token, username)
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ func (t *tokenReqCtxModifier) Modify(ctx *beegoctx.Context) bool {
|
||||
|
||||
log.Debug("got token from request")
|
||||
|
||||
authContext, err := authcontext.GetAuthCtxOfCurrentUser(config.AdmiralClient,
|
||||
authContext, err := authcontext.GetAuthCtx(config.AdmiralClient,
|
||||
config.AdmiralEndpoint(), token)
|
||||
if err != nil {
|
||||
log.Errorf("failed to get auth context: %v", err)
|
||||
|
@ -304,7 +304,7 @@ func (p *ProjectManager) GetPublic() ([]*models.Project, error) {
|
||||
// GetByMember ...
|
||||
func (p *ProjectManager) GetByMember(username string) ([]*models.Project, error) {
|
||||
projects := []*models.Project{}
|
||||
ctx, err := authcontext.GetAuthCtxOfSpecificUser(p.client, p.endpoint, p.getToken(), username)
|
||||
ctx, err := authcontext.GetAuthCtxOfUser(p.client, p.endpoint, p.getToken(), username)
|
||||
if err != nil {
|
||||
return projects, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user