Draft: (WIP) Add IAM Service OAuth feature flag for JWT authentication

What does this MR do and why?

Add IAM Service OAuth feature flag for JWT authentication

Introduces iam_svc_oauth feature flag to enable JWT authentication from external IAM service as an alternative to Doorkeeper OAuth.

Changes:

  • Add feature flag iam_svc_oauth (disabled by default)
  • Add Gitlab::Auth::IamJwt module with error hierarchy
  • Add Gitlab::Auth::IamJwt::Token class for validated JWTs
  • Add Gitlab::Auth::IamJwt::JwksClient for RS256 key fetching/caching
  • Add Auth::IamJwtValidationService for JWT signature verification
  • Integrate IAM JWT check into AuthFinders before OAuth
  • Add IAM JWT attributes to Current class
  • Add ApplicationSetting fields for IAM service configuration

Related to: #580758

WIP

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading