This commit is contained in:
Wenkai Yin 2017-07-04 12:20:58 +08:00
parent d2eb8fc8b6
commit aac742e8ba
3 changed files with 6 additions and 6 deletions

View File

@ -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)
}

View File

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

View File

@ -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
}