Skip to content

Commit 81fd6af

Browse files
henrybarretogustavosbarreto
authored andcommitted
feat(api,openapi,pkg): add admin field on authentication return
1 parent 2299a6c commit 81fd6af

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

api/services/auth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ func (s *service) AuthLocalUser(ctx context.Context, req *requests.AuthLocalUser
367367
Role: role,
368368
Token: token,
369369
MaxNamespaces: user.MaxNamespaces,
370+
Admin: user.Admin,
370371
}
371372

372373
return res, 0, "", nil

openapi/spec/components/schemas/userAuth.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,9 @@ properties:
2626
type: boolean
2727
description: Indicates whether the user has MFA enabled.
2828
example: false
29+
admin:
30+
type: boolean
31+
description: Indicates whether the user has admin status.
32+
example: false
2933
max_namespaces:
3034
$ref: maxNamespaces.yaml

pkg/models/user.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ type UserAuthResponse struct {
166166
Role string `json:"role"`
167167
MFA bool `json:"mfa"`
168168
MaxNamespaces int `json:"max_namespaces"`
169+
Admin bool `json:"admin"`
169170
}
170171

171172
// NOTE: This struct has been moved to the cloud repo as it is only used in a cloud context;

0 commit comments

Comments
 (0)