-
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): Update default OAuth configuration
- Loading branch information
Showing
31 changed files
with
658 additions
and
124 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
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 |
11 changes: 11 additions & 0 deletions
11
...i/yaml/validator/src/rules/valid-oauth/__test__/fixtures/valid/default/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: valid-default | ||
imports: | ||
auth: auth.yml | ||
|
||
auth: OAuthScheme | ||
auth-schemes: | ||
OAuthScheme: | ||
scheme: oauth | ||
type: client-credentials | ||
get-token: | ||
endpoint: auth.getToken |
22 changes: 22 additions & 0 deletions
22
.../yaml/validator/src/rules/valid-oauth/__test__/fixtures/valid/default/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,22 @@ | ||
types: | ||
TokenResponse: | ||
docs: | | ||
An OAuth token response. | ||
properties: | ||
access_token: string | ||
|
||
service: | ||
auth: false | ||
base-path: / | ||
endpoints: | ||
getToken: | ||
path: /token | ||
method: POST | ||
request: | ||
name: GetTokenRequest | ||
body: | ||
properties: | ||
client_id: string | ||
client_secret: string | ||
grant_type: literal<"client_credentials"> | ||
response: TokenResponse |
1 change: 0 additions & 1 deletion
1
packages/cli/yaml/validator/src/rules/valid-oauth/__test__/fixtures/valid/generators.yml
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
...lidator/src/rules/valid-oauth/__test__/fixtures/valid/query-parameters/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: valid-default | ||
imports: | ||
auth: auth.yml | ||
|
||
auth: OAuthScheme | ||
auth-schemes: | ||
OAuthScheme: | ||
scheme: oauth | ||
type: client-credentials | ||
get-token: | ||
endpoint: auth.getToken |
20 changes: 20 additions & 0 deletions
20
...idator/src/rules/valid-oauth/__test__/fixtures/valid/query-parameters/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,20 @@ | ||
types: | ||
TokenResponse: | ||
docs: | | ||
An OAuth token response. | ||
properties: | ||
access_token: string | ||
|
||
service: | ||
auth: false | ||
base-path: / | ||
endpoints: | ||
getToken: | ||
path: /token | ||
method: GET | ||
request: | ||
name: GetTokenRequest | ||
query-parameters: | ||
client_id: string | ||
client_secret: string | ||
response: TokenResponse |
2 changes: 1 addition & 1 deletion
2
..._test__/fixtures/valid/definition/api.yml → .../fixtures/valid/simple/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: valid | ||
imports: | ||
imports: | ||
auth: auth.yml | ||
|
||
auth: OAuthScheme | ||
|
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
Oops, something went wrong.