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

[REQ] Support for withAWSV4Signature in TypeScript Axios Generator

Open kcsuraj opened this issue 5 years ago • 8 comments

TypeScript generator lacks support for signing apis with AWS v4 generator.

This generator lacks withAWSV4Signature which indicates whether to include AWS v4 signature support. This feature is available in Go generator: https://openapi-generator.tech/docs/generators/go/

So, it would be great to have support for this feature in TypeScript Axios generator as well. https://openapi-generator.tech/docs/generators/typescript-axios/

kcsuraj avatar Jul 23 '20 17:07 kcsuraj

@kcsuraj may I know if you've time to contribute the enhancement? We can show you some good starting points to start with.

wing328 avatar Jul 30 '20 01:07 wing328

@wing328 Sure. I can give it a try.

kcsuraj avatar Jul 30 '20 07:07 kcsuraj

@wing328 Can you post those starting points?

jarruda avatar Jan 06 '21 21:01 jarruda

Here is the PR to add AWS V4 signature support to the Go client generator: https://github.com/OpenAPITools/openapi-generator/pull/7326/files.

wing328 avatar Jan 07 '21 02:01 wing328

Following up on this:

I see two paths forward here, we could

a) utilize the https://github.com/jamesmbourne/aws4-axios and implement as an interceptor, as seen in @jarruda's commit b) Implement using system libraries, similar to https://github.com/mhart/aws4, implementing it similar to the existing auth methods which are added here: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache#L30 https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache#L5

Do we have a preference for this?

I'm inclined for option b, as it avoids a third-party dependency, but may require additional maintenance in the future if sigv4 were to change

ColeMurray avatar May 15 '21 05:05 ColeMurray

Hi there, I was wondering if any of you had found a workaround to sign requests generated by the typescript-axios generator without editing the generated files? I've been trying to wrap my head around this, but so far couldn't make it work, I find myself re-implementing the client myself and using the generated client only for types, which is a shame.

cohlar avatar Feb 16 '23 08:02 cohlar

Hey guys, I managed to create a PR to support this using https://github.com/jamesmbourne/aws4-axios as this is the library I personally am familiar with, have a look at it, would appreciate a review there https://github.com/OpenAPITools/openapi-generator/pull/18215

varqasim avatar Mar 24 '24 11:03 varqasim

Attempting to make some forward progress #21356

NiltiakSivad avatar May 30 '25 18:05 NiltiakSivad