spring-cloud / spring-cloud/spring-cloud-gateway

Provide Predicate Factory that examines Authentication / Principal

Open
#2,128 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
4.9k
Forks
3.5k
Avg merge
20h 57m
Merged PRs (30d)
8

Description

We have some use cases where we would like to route based on attributes of the Authentication / Principal from the spring security context. For example, principal name, or token attributes such as oauth client id, account id, etc

We were thinking about developing a predicate factory to do this in our code, but I wanted to see if spring-cloud-gateway could provide first-class support for this. Thoughts? I'd consider making a contribution, but want to confirm before going down that path.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the existing route predicate factories and how Spring Security authentication or principal data is exposed in the gateway. Define the first-class predicate behavior for attributes such as principal name, OAuth client ID, and account ID, then validate that the proposed scope and API are supported by focused tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.