-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1648 from hey-api/feat/auth-open-id-connect
fix: add support for openIdConnect auth flow
- Loading branch information
Showing
32 changed files
with
340 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@hey-api/openapi-ts': patch | ||
--- | ||
|
||
fix: add support for openIdConnect auth flow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/openapi-ts/test/__snapshots__/3.0.x/security-open-id-connect/client.gen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
import { createClient, createConfig } from '@hey-api/client-fetch'; | ||
|
||
export const client = createClient(createConfig()); |
3 changes: 3 additions & 0 deletions
3
packages/openapi-ts/test/__snapshots__/3.0.x/security-open-id-connect/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
export * from './types.gen'; | ||
export * from './sdk.gen'; |
27 changes: 27 additions & 0 deletions
27
packages/openapi-ts/test/__snapshots__/3.0.x/security-open-id-connect/sdk.gen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; | ||
import type { GetFooData } from './types.gen'; | ||
import { client as _heyApiClient } from './client.gen'; | ||
|
||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & { | ||
/** | ||
* You can provide a client instance returned by `createClient()` instead of | ||
* individual options. This might be also useful if you want to implement a | ||
* custom client. | ||
*/ | ||
client?: Client; | ||
}; | ||
|
||
export const getFoo = <ThrowOnError extends boolean = false>(options?: Options<GetFooData, ThrowOnError>) => { | ||
return (options?.client ?? _heyApiClient).get<unknown, unknown, ThrowOnError>({ | ||
security: [ | ||
{ | ||
scheme: 'bearer', | ||
type: 'http' | ||
} | ||
], | ||
url: '/foo', | ||
...options | ||
}); | ||
}; |
15 changes: 15 additions & 0 deletions
15
packages/openapi-ts/test/__snapshots__/3.0.x/security-open-id-connect/types.gen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
export type GetFooData = { | ||
body?: never; | ||
path?: never; | ||
query?: never; | ||
url: '/foo'; | ||
}; | ||
|
||
export type GetFooResponses = { | ||
/** | ||
* OK | ||
*/ | ||
200: unknown; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...enapi-ts/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.cts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...penapi-ts/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...penapi-ts/test/__snapshots__/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.cts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...openapi-ts/test/__snapshots__/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/openapi-ts/test/__snapshots__/3.1.x/security-open-id-connect/client.gen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
import { createClient, createConfig } from '@hey-api/client-fetch'; | ||
|
||
export const client = createClient(createConfig()); |
3 changes: 3 additions & 0 deletions
3
packages/openapi-ts/test/__snapshots__/3.1.x/security-open-id-connect/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
export * from './types.gen'; | ||
export * from './sdk.gen'; |
27 changes: 27 additions & 0 deletions
27
packages/openapi-ts/test/__snapshots__/3.1.x/security-open-id-connect/sdk.gen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; | ||
import type { GetFooData } from './types.gen'; | ||
import { client as _heyApiClient } from './client.gen'; | ||
|
||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & { | ||
/** | ||
* You can provide a client instance returned by `createClient()` instead of | ||
* individual options. This might be also useful if you want to implement a | ||
* custom client. | ||
*/ | ||
client?: Client; | ||
}; | ||
|
||
export const getFoo = <ThrowOnError extends boolean = false>(options?: Options<GetFooData, ThrowOnError>) => { | ||
return (options?.client ?? _heyApiClient).get<unknown, unknown, ThrowOnError>({ | ||
security: [ | ||
{ | ||
scheme: 'bearer', | ||
type: 'http' | ||
} | ||
], | ||
url: '/foo', | ||
...options | ||
}); | ||
}; |
Oops, something went wrong.