Deny suspended directory identities
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 24s
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 24s
This commit is contained in:
parent
76da0237ff
commit
909bb327fc
4 changed files with 67 additions and 7 deletions
|
|
@ -108,6 +108,14 @@ func (h *TokenHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
http.Error(w, "user not found", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if isSuspended(user) {
|
||||
h.Sessions.Delete(code)
|
||||
profileerrors.RejectedForSafety(
|
||||
"account is suspended",
|
||||
"account_lifecycle",
|
||||
).Write(w, http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
// 6. Build JWT claims.
|
||||
now := time.Now()
|
||||
|
|
@ -270,6 +278,10 @@ func containsString(values []string, wanted string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func isSuspended(user *domain.User) bool {
|
||||
return containsString(user.Groups, "netkingdom-suspended")
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// IAM Profile core claims (KEY-WP-0005-T01)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue