-
-
Notifications
You must be signed in to change notification settings - Fork 930
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reenable and fix schema tests (#737)
- Loading branch information
Showing
42 changed files
with
290 additions
and
168 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Schema Tests | ||
|
||
This test works by validating cases of the payload against a schema. | ||
To add a case, place a file in the `${schemaName}.schema.test.${success|failure}` folder. | ||
A success case should validate, a failure case should throw a validation error. | ||
|
||
## Handling of "$ref" | ||
|
||
To allow testing definitions on their own, and reduce the size of individual cases, | ||
every `"$ref"` in the schema will be replaced with `"const"` before validation. | ||
This means that a case only has to define the pointer as a string. Example: | ||
|
||
```yaml | ||
default_browser_return_url: "#/definitions/defaultReturnTo" | ||
hooks: | ||
- "#/definitions/selfServiceSessionRevokerHook" | ||
``` |
10 changes: 10 additions & 0 deletions
10
test/schema/fixtures/config.schema.test.failure/root.defaultSchemaNotAllowed.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,10 @@ | ||
selfservice: | ||
default_browser_return_url: "#/definitions/defaultReturnTo" | ||
|
||
dsn: foo | ||
|
||
identity: | ||
default_schema_url: https://example.com | ||
schemas: | ||
- id: default | ||
url: file://path/to/identity.traits.schema.json |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
test/schema/fixtures/config.schema.test.failure/root.requiresCourierRecovery.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,10 @@ | ||
selfservice: | ||
default_browser_return_url: "#/definitions/defaultReturnTo" | ||
flows: | ||
recovery: | ||
enabled: true | ||
|
||
dsn: foo | ||
|
||
identity: | ||
default_schema_url: https://example.com |
10 changes: 10 additions & 0 deletions
10
test/schema/fixtures/config.schema.test.failure/root.requiresCourierVerification.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,10 @@ | ||
selfservice: | ||
default_browser_return_url: "#/definitions/defaultReturnTo" | ||
flows: | ||
verification: | ||
enabled: true | ||
|
||
dsn: foo | ||
|
||
identity: | ||
default_schema_url: https://example.com |
11 changes: 11 additions & 0 deletions
11
test/schema/fixtures/config.schema.test.failure/selfServiceOIDCProvider.invalidTypes.yaml
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 @@ | ||
id: 1 | ||
provider: unknown | ||
client_id: 1 | ||
client_secret: 1 | ||
issuer_url: not an URL | ||
auth_url: not an URL | ||
token_url: not an URL | ||
mapper_url: not an URL | ||
scope: | ||
- 1 | ||
tenant: 1 |
6 changes: 6 additions & 0 deletions
6
...hema/fixtures/config.schema.test.failure/selfServiceOIDCProvider.tenantNotWithGithub.yaml
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,6 @@ | ||
id: foo | ||
provider: github | ||
client_id: asdf | ||
client_secret: asdf | ||
mapper_url: file://./mapper_file | ||
tenant: org |
5 changes: 5 additions & 0 deletions
5
...tures/config.schema.test.failure/selfServiceOIDCProvider.tenantRequiredWithMicrosoft.yaml
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 @@ | ||
id: foo | ||
provider: microsoft | ||
client_id: asdf | ||
client_secret: asdf | ||
mapper_url: file://./mapper_file |
1 change: 1 addition & 0 deletions
1
test/schema/fixtures/config.schema.test.failure/version.invalid.yaml
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 @@ | ||
x1.0.0 |
95 changes: 0 additions & 95 deletions
95
test/schema/fixtures/config.schema.test.success/allKeys.main.yaml
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
test/schema/fixtures/config.schema.test.success/allKeys.selfServiceAfterLogin.yaml
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
test/schema/fixtures/config.schema.test.success/allKeys.selfServiceAfterLoginHooks.yaml
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
...schema/fixtures/config.schema.test.success/allKeys.selfServiceAfterRegistrationHooks.yaml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/schema/fixtures/config.schema.test.success/allKeys.selfServiceBefore.yaml
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
test/schema/fixtures/config.schema.test.success/allKeys.selfServiceRedirectHook.yaml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/schema/fixtures/config.schema.test.success/allKeys.selfServiceSessionIssuerHook.yaml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/schema/fixtures/config.schema.test.success/allKeys.selfServiceSessionRevokerHook.yaml
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
test/schema/fixtures/config.schema.test.success/defaultReturnTo.URI-Reference.yaml
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 @@ | ||
/dashboard |
1 change: 1 addition & 0 deletions
1
test/schema/fixtures/config.schema.test.success/defaultReturnTo.URL.yaml
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 @@ | ||
https://my-app.com/dashboard |
Oops, something went wrong.