OpenAPITools / OpenAPITools/openapi-generator

[REQ] [JAVA] [SPRING] add option to pass authorization token in a method parameter instead of interceptor

Open
#24,087 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Problem

My service is written in Java Spring and I want to use open feign for rest clients. My service performs simultaneously multiple actions, each on behalf of a different principal. As of now an interceptor the only option to authorize requests, and it is cumbersome to use interceptor in my service, as the interceptor have no easy way of knowing what principal to use.

Solution

I would like to pass authorization in a method parameter instead of using interceptor. E.g.

    String somethingGet(@RequestHeader(value = "Authorization") String auth);

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

No file or test is named. Start by tracing Java Spring client generation and the current authorization interceptor handling; determine where method parameters are represented in the generated client. Done means the generated method can accept an Authorization value per call instead of relying only on the interceptor, with coverage for simultaneous principals.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi, spring
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.