feat: allow admins to auto grant APIs to CIMD clients (#1692)

This commit is contained in:
Elias Schneider
2026-08-18 20:02:14 +02:00
committed by GitHub
parent 22354581df
commit 915a6bcf08
38 changed files with 2605 additions and 393 deletions
@@ -136,6 +136,20 @@ func (h *authorizationHandler) completeInteraction(c *gin.Context) {
}
func (h *authorizationHandler) writeAuthorizeError(ctx context.Context, c *gin.Context, ar fosite.AuthorizeRequester, err error) {
if rfcErr, ok := errors.AsType[*fosite.RFC6749Error](err); ok {
attrs := []slog.Attr{
slog.String("error", rfcErr.ErrorField),
slog.String("description", rfcErr.DescriptionField),
slog.String("hint", rfcErr.Reason()),
slog.String("debug", rfcErr.Debug()),
slog.Int("status_code", rfcErr.StatusCode()),
}
if cause := rfcErr.Cause(); cause != nil {
attrs = append(attrs, slog.String("cause", cause.Error()))
}
slog.LogAttrs(ctx, slog.LevelDebug, "Fosite authorize error details", attrs...)
}
// Keep authorization policy denials in Pocket ID so users can see why access was refused
if errors.Is(err, fosite.ErrAccessDenied) {
h.redirectToInteractionError(c, err)