openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[typescript-axios] Add detection for AWS IAM from schema

Open NiltiakSivad opened this issue 8 months ago • 2 comments

Previous Efforts

Here is the open issue.

I've taken over the effort that was originally started, here. It was suggested in this PR that rather than use a CLI flag like useAwsIamAuth, that we detect IAM Auth from the schema itself.

Summary

This is the first PR of 2. I thought it would be good to talk about the IAM auth detection mechanism before talking about the implementation method in the templates.

At a high-level I'm proposing 3 patterns for detecting AWS IAM Auth.

  1. Check for AWS-specific extension
  2. Check for common AWS V4 signature scheme names
  3. Check for AWS API Gateway URL patterns in servers

It is up for discussion the pro/cons of each, and perhaps we end up with only 1 or a subset of the 3.

Deployment

This is a non-breaking change, as it is adding a variable to be returned to the templates, so I think merging into master is sufficient, but let me know if you think differently! I really hate Java and first PR contributing to this repo so looking for any and all feedback to follow standards/conventions. Any deviation from standards/conventions is not intentional so please lmk.

PR checklist

  • [x] Read the contribution guidelines.
  • [x] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • [x] Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL) Commit all changed files. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • [ ] File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • [x] If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) @davidgamero (2022/03) @mkusaka (2022/04) @joscha (2024/10)

NiltiakSivad avatar May 30 '25 18:05 NiltiakSivad

Rebased against master to capture latest updates

NiltiakSivad avatar Jun 03 '25 19:06 NiltiakSivad

Hey @wing328 @jimschubert @cbornet @jmini @etherealjoy, apologies to tag you here, but looking for a PR review. Did I not tag the right people or follow the correct process?

NiltiakSivad avatar Jun 09 '25 13:06 NiltiakSivad