Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 committed Jul 7, 2021
1 parent 82427ad commit 91cff17
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/auth/manager/demo/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (m *manager) Authenticate(ctx context.Context, clientID, clientSecret strin
if c.Secret == clientSecret {
var scopes map[string]*authpb.Scope
var err error
if c.User.Id.Type == user.UserType_USER_TYPE_LIGHTWEIGHT {
if c.User.Id != nil && c.User.Id.Type == user.UserType_USER_TYPE_LIGHTWEIGHT {
scopes, err = scope.AddLightweightAccountScope(authpb.Role_ROLE_OWNER, nil)
if err != nil {
return nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/manager/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (m *manager) Authenticate(ctx context.Context, username string, secret stri
if c.Secret == secret {
var scopes map[string]*authpb.Scope
var err error
if c.ID.Type == user.UserType_USER_TYPE_LIGHTWEIGHT {
if c.ID != nil && c.ID.Type == user.UserType_USER_TYPE_LIGHTWEIGHT {
scopes, err = scope.AddLightweightAccountScope(authpb.Role_ROLE_OWNER, nil)
if err != nil {
return nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/manager/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (am *mgr) Authenticate(ctx context.Context, clientID, clientSecret string)
}

var scopes map[string]*authpb.Scope
if userID.Type == user.UserType_USER_TYPE_LIGHTWEIGHT {
if userID != nil && userID.Type == user.UserType_USER_TYPE_LIGHTWEIGHT {
scopes, err = scope.AddLightweightAccountScope(authpb.Role_ROLE_OWNER, nil)
if err != nil {
return nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/manager/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (am *mgr) Authenticate(ctx context.Context, clientID, clientSecret string)
}

var scopes map[string]*authpb.Scope
if userID.Type == user.UserType_USER_TYPE_LIGHTWEIGHT {
if userID != nil && userID.Type == user.UserType_USER_TYPE_LIGHTWEIGHT {
scopes, err = scope.AddLightweightAccountScope(authpb.Role_ROLE_OWNER, nil)
if err != nil {
return nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/utils/eosfs/eosfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,7 @@ func (fs *eosfs) extractUIDAndGID(u *userpb.User) (eosclient.Authorization, erro
if u.GidNumber == 0 {
return eosclient.Authorization{}, errors.New("eosfs: gid missing for user")
}
return eosclient.Authorization{Role: eosclient.Role{strconv.FormatInt(u.UidNumber, 10), strconv.FormatInt(u.GidNumber, 10)}}, nil
return eosclient.Authorization{Role: eosclient.Role{UID: strconv.FormatInt(u.UidNumber, 10), GID: strconv.FormatInt(u.GidNumber, 10)}}, nil
}

func (fs *eosfs) getUIDGateway(ctx context.Context, u *userpb.UserId) (eosclient.Authorization, error) {
Expand Down

0 comments on commit 91cff17

Please sign in to comment.