-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(improvement, yaml): Add and update default OAuth YAML configuration
- Loading branch information
Showing
44 changed files
with
928 additions
and
189 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,7 @@ | ||
export interface DocsLinks { | ||
oauth: string; | ||
} | ||
|
||
export const DocsLinks: DocsLinks = { | ||
oauth: "https://buildwithfern.com/learn/api-definition/fern/api-yml-reference#authentication" | ||
}; |
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
14 changes: 7 additions & 7 deletions
14
...est__/fixtures/invalid/definition/api.yml → ...xtures/invalid/missing/definition/api.yml
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
14 changes: 14 additions & 0 deletions
14
...alidator/src/rules/valid-oauth/__test__/fixtures/invalid/property-path/definition/api.yml
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,14 @@ | ||
name: invalid | ||
imports: | ||
auth: auth.yml | ||
|
||
auth: OAuthScheme | ||
auth-schemes: | ||
OAuthScheme: | ||
scheme: oauth | ||
type: client-credentials | ||
get-token: | ||
endpoint: auth.getToken | ||
request-properties: | ||
client-id: $request.credentials.client_id | ||
client-secret: $request.credentials.client_secret |
29 changes: 29 additions & 0 deletions
29
...lidator/src/rules/valid-oauth/__test__/fixtures/invalid/property-path/definition/auth.yml
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,29 @@ | ||
types: | ||
TokenCredentials: | ||
docs: | | ||
The credentials required to retrieve an access token. | ||
properties: | ||
client_id: string | ||
client_secret: string | ||
|
||
TokenResponse: | ||
docs: | | ||
An OAuth token response. | ||
properties: | ||
access_token: string | ||
expires_in: integer | ||
refresh_token: optional<string> | ||
|
||
service: | ||
auth: false | ||
base-path: / | ||
endpoints: | ||
getToken: | ||
path: /token | ||
method: POST | ||
request: | ||
name: GetTokenRequest | ||
body: | ||
properties: | ||
credentials: TokenCredentials | ||
response: TokenResponse |
13 changes: 13 additions & 0 deletions
13
...i/yaml/validator/src/rules/valid-oauth/__test__/fixtures/invalid/types/definition/api.yml
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,13 @@ | ||
name: invalid | ||
imports: | ||
auth: auth.yml | ||
|
||
auth: OAuthScheme | ||
auth-schemes: | ||
OAuthScheme: | ||
scheme: oauth | ||
type: client-credentials | ||
get-token: | ||
endpoint: auth.getToken | ||
request-properties: | ||
scopes: $request.scopes |
24 changes: 24 additions & 0 deletions
24
.../yaml/validator/src/rules/valid-oauth/__test__/fixtures/invalid/types/definition/auth.yml
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,24 @@ | ||
types: | ||
TokenResponse: | ||
docs: | | ||
An OAuth token response. | ||
properties: | ||
access_token: string | ||
expires_in: integer | ||
refresh_token: optional<string> | ||
|
||
service: | ||
auth: false | ||
base-path: / | ||
endpoints: | ||
getToken: | ||
path: /token | ||
method: POST | ||
request: | ||
name: GetTokenRequest | ||
body: | ||
properties: | ||
client_id: uuid | ||
client_secret: uuid | ||
scopes: integer | ||
response: TokenResponse |
11 changes: 11 additions & 0 deletions
11
...cli/yaml/validator/src/rules/valid-oauth/__test__/fixtures/valid/alias/definition/api.yml
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,11 @@ | ||
name: alias | ||
imports: | ||
auth: auth.yml | ||
|
||
auth: OAuthScheme | ||
auth-schemes: | ||
OAuthScheme: | ||
scheme: oauth | ||
type: client-credentials | ||
get-token: | ||
endpoint: auth.getToken |
26 changes: 26 additions & 0 deletions
26
...li/yaml/validator/src/rules/valid-oauth/__test__/fixtures/valid/alias/definition/auth.yml
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,26 @@ | ||
types: | ||
ClientID: string | ||
ClientSecret: string | ||
AccessToken: string | ||
|
||
TokenResponse: | ||
docs: | | ||
An OAuth token response. | ||
properties: | ||
access_token: AccessToken | ||
|
||
service: | ||
auth: false | ||
base-path: / | ||
endpoints: | ||
getToken: | ||
path: /token | ||
method: POST | ||
request: | ||
name: GetTokenRequest | ||
body: | ||
properties: | ||
client_id: ClientID | ||
client_secret: ClientSecret | ||
grant_type: literal<"client_credentials"> | ||
response: TokenResponse |
Oops, something went wrong.