diff --git a/.docker_compose/config.yaml b/.docker_compose/config.yaml index de024a758f..2df5698819 100644 --- a/.docker_compose/config.yaml +++ b/.docker_compose/config.yaml @@ -26,7 +26,7 @@ mutators: enabled: true config: headers: - X-User: "{{ print .Subject }}" + X-User: '{{ print .Subject }}' noop: enabled: true id_token: diff --git a/.docker_compose/rules.json b/.docker_compose/rules.json index 737f312218..61e9c6c856 100644 --- a/.docker_compose/rules.json +++ b/.docker_compose/rules.json @@ -1,99 +1,93 @@ [ - { - "id": "allow-anonymous-with-header-mutator", - "upstream": { - "url": "https://httpbin.org/anything/header" - }, - "match": { - "url": "http://<127.0.0.1|localhost>:4455/anything/header", - "methods": [ - "GET" - ] - }, - "authenticators": [ - { - "handler": "anonymous" - } - ], - "authorizer": { - "handler": "allow" - }, - "mutators": [ - { - "handler": "header", - "config": { - "headers": { - "X-User": "{{ print .Subject }}" - } - } - } - ] + { + "id": "allow-anonymous-with-header-mutator", + "upstream": { + "url": "https://httpbin.org/anything/header" }, - { - "id": "deny-anonymous", - "upstream": { - "url": "https://httpbin.org/anything/deny" - }, - "match": { - "url": "http://<127.0.0.1|localhost>:4455/anything/deny", - "methods": [ - "GET" - ] - }, - "authenticators": [ - { - "handler": "anonymous" - } - ], - "authorizer": { - "handler": "deny" - }, - "mutators": [ - { - "handler": "noop" - } - ], - "errors": [ + "match": { + "url": "http://<127.0.0.1|localhost>:4455/anything/header", + "methods": ["GET"] + }, + "authenticators": [ + { + "handler": "anonymous" + } + ], + "authorizer": { + "handler": "allow" + }, + "mutators": [ + { + "handler": "header", + "config": { + "headers": { + "X-User": "{{ print .Subject }}" + } + } + } + ] + }, + { + "id": "deny-anonymous", + "upstream": { + "url": "https://httpbin.org/anything/deny" + }, + "match": { + "url": "http://<127.0.0.1|localhost>:4455/anything/deny", + "methods": ["GET"] + }, + "authenticators": [ + { + "handler": "anonymous" + } + ], + "authorizer": { + "handler": "deny" + }, + "mutators": [ + { + "handler": "noop" + } + ], + "errors": [ + { + "handler": "json", + "config": { + "when": [ { - "handler": "json", - "config": { - "when": [ - { - "request": { - "header": { - "accept": ["application/json"] - } - } - } - ] + "request": { + "header": { + "accept": ["application/json"] } - }, + } + } + ] + } + }, + { + "handler": "redirect", + "config": { + "when": [ { - "handler": "redirect", - "config": { - "when": [ - { - "request": { - "header": { - "accept": ["text/*"] - } - } - } - ] + "request": { + "header": { + "accept": ["text/*"] } + } } - ] + ] + } + } + ] + }, + { + "id": "allow-anonymous-with-id-token-mutator", + "upstream": { + "url": "https://httpbin.org/anything/id_token" }, - { - "id": "allow-anonymous-with-id-token-mutator", - "upstream": { - "url": "https://httpbin.org/anything/id_token" - }, "match": { "url": "http://<127.0.0.1|localhost>:4455/anything/id_token", - "methods": [ - "GET" - ] + "methods": ["GET"] }, "authenticators": [ { diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8125a1915d..d8bcb167f0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -38,18 +38,13 @@ If you're unsure about any of them, don't hesitate to ask. We're here to help! --> - [ ] I have read the [contributing guidelines](../blob/master/CONTRIBUTING.md). -- [ ] I have referenced an issue containing the design document if my change - introduces a new feature. -- [ ] I am following the - [contributing code guidelines](../blob/master/CONTRIBUTING.md#contributing-code). +- [ ] I have referenced an issue containing the design document if my change introduces a new feature. +- [ ] I am following the [contributing code guidelines](../blob/master/CONTRIBUTING.md#contributing-code). - [ ] I have read the [security policy](../security/policy). -- [ ] I confirm that this pull request does not address a security - vulnerability. If this pull request addresses a security. vulnerability, I - confirm that I got green light (please contact - [security@ory.sh](mailto:security@ory.sh)) from the maintainers to push - the changes. -- [ ] I have added tests that prove my fix is effective or that my feature - works. +- [ ] I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security. + vulnerability, I confirm that I got green light (please contact [security@ory.sh](mailto:security@ory.sh)) from the + maintainers to push the changes. +- [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added or changed [the documentation](https://github.com/ory/docs). ## Further Comments diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbf401c93e..15ef44fa0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: runs-on: ubuntu-latest name: Run tests strategy: - matrix: + matrix: name: ['reload', 'e2e', 'forwarded-header'] needs: - sdk-generate diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 46ecbeb301..2079a1fcc2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,14 +9,14 @@ # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # -name: "CodeQL" +name: 'CodeQL' on: push: - branches: [ master ] + branches: [master] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [master] schedule: - cron: '26 0 * * 2' @@ -32,40 +32,40 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'go' ] + language: ['go'] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release + #- run: | + # make bootstrap + # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/cve-scan.yaml b/.github/workflows/cve-scan.yaml index 8cdc05f381..058a0eb61f 100644 --- a/.github/workflows/cve-scan.yaml +++ b/.github/workflows/cve-scan.yaml @@ -62,7 +62,7 @@ jobs: uses: aquasecurity/trivy-action@master if: ${{ always() }} with: - image-ref: oryd/oathkeeper:${{ steps.vars.outputs.sha_short }} + image-ref: oryd/oathkeeper:${{ steps.vars.outputs.sha_short }} format: 'table' exit-code: '42' ignore-unfixed: true @@ -72,7 +72,7 @@ jobs: uses: aquasecurity/trivy-action@master if: ${{ always() }} with: - image-ref: oryd/oathkeeper:alpine-${{ steps.vars.outputs.sha_short }} + image-ref: oryd/oathkeeper:alpine-${{ steps.vars.outputs.sha_short }} format: 'table' exit-code: '42' ignore-unfixed: true @@ -82,13 +82,13 @@ jobs: uses: erzz/dockle-action@v1.1.1 if: ${{ always() }} with: - image: oryd/oathkeeper:${{ steps.vars.outputs.sha_short }} + image: oryd/oathkeeper:${{ steps.vars.outputs.sha_short }} exit-code: 42 failure-threshold: fatal - name: Dockle Linter uses: erzz/dockle-action@v1.1.1 if: ${{ always() }} with: - image: oryd/oathkeeper:alpine-${{ steps.vars.outputs.sha_short }} + image: oryd/oathkeeper:alpine-${{ steps.vars.outputs.sha_short }} exit-code: 42 failure-threshold: fatal diff --git a/.goreleaser.yml b/.goreleaser.yml index 2912b08a26..0a306c59db 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -6,17 +6,19 @@ before: hooks: - go mod download - git checkout -- go.sum go.mod - - curl -Lo /tmp/cosign.key https://raw.githubusercontent.com/ory/xgoreleaser/master/cosign.key - - curl -Lo /tmp/cosign.pub https://raw.githubusercontent.com/ory/xgoreleaser/master/cosign.pub + - 'curl -Lo /tmp/cosign.key + https://raw.githubusercontent.com/ory/xgoreleaser/master/cosign.key' + - 'curl -Lo /tmp/cosign.pub + https://raw.githubusercontent.com/ory/xgoreleaser/master/cosign.pub' - go install github.com/gobuffalo/packr/v2/packr2 - packr2 variables: brew_name: oathkeeper - brew_description: "The Ory Identity and Access Proxy (Ory Oathkeeper)" - buildinfo_hash: "github.com/ory/oathkeeper/x.Commit" - buildinfo_tag: "github.com/ory/oathkeeper/x.Version" - buildinfo_date: "github.com/ory/oathkeeper/x.Date" - dockerfile: "./Dockerfile-alpine" + brew_description: 'The Ory Identity and Access Proxy (Ory Oathkeeper)' + buildinfo_hash: 'github.com/ory/oathkeeper/x.Commit' + buildinfo_tag: 'github.com/ory/oathkeeper/x.Version' + buildinfo_date: 'github.com/ory/oathkeeper/x.Date' + dockerfile: './Dockerfile-alpine' project_name: oathkeeper diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.schema/api.swagger.json b/.schema/api.swagger.json index ca898aeeac..1d89c2938f 100755 --- a/.schema/api.swagger.json +++ b/.schema/api.swagger.json @@ -1,14 +1,7 @@ { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "http", - "https" - ], + "consumes": ["application/json"], + "produces": ["application/json"], + "schemes": ["http", "https"], "swagger": "2.0", "info": { "description": "ORY Oathkeeper is a reverse proxy that checks the HTTP Authorization for validity against a set of rules. This service uses Hydra to validate access tokens and policies.", @@ -25,16 +18,9 @@ "/.well-known/jwks.json": { "get": { "description": "This endpoint returns cryptographic keys that are required to, for example, verify signatures of ID Tokens.", - "produces": [ - "application/json" - ], - "schemes": [ - "http", - "https" - ], - "tags": [ - "api" - ], + "produces": ["application/json"], + "schemes": ["http", "https"], + "tags": ["api"], "summary": "Lists cryptographic keys", "operationId": "getWellKnownJSONWebKeys", "responses": { @@ -81,13 +67,8 @@ "/decisions": { "get": { "description": "\u003e This endpoint works with all HTTP Methods (GET, POST, PUT, ...) and matches every path prefixed with /decision.\n\nThis endpoint mirrors the proxy capability of ORY Oathkeeper's proxy functionality but instead of forwarding the\nrequest to the upstream server, returns 200 (request should be allowed), 401 (unauthorized), or 403 (forbidden)\nstatus codes. This endpoint can be used to integrate with other API Proxies like Ambassador, Kong, Envoy, and many more.", - "schemes": [ - "http", - "https" - ], - "tags": [ - "api" - ], + "schemes": ["http", "https"], + "tags": ["api"], "summary": "Access Control Decision API", "operationId": "decisions", "responses": { @@ -224,12 +205,8 @@ "/health/alive": { "get": { "description": "This endpoint returns a 200 status code when the HTTP server is up running.\nThis status does currently not include checks whether the database connection is working.\n\nIf the service supports TLS Edge Termination, this endpoint does not require the\n`X-Forwarded-Proto` header to be set.\n\nBe aware that if you are running multiple nodes of this service, the health status will never\nrefer to the cluster state, only to a single instance.", - "produces": [ - "application/json" - ], - "tags": [ - "api" - ], + "produces": ["application/json"], + "tags": ["api"], "summary": "Check alive status", "operationId": "isInstanceAlive", "responses": { @@ -276,12 +253,8 @@ "/health/ready": { "get": { "description": "This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g.\nthe database) are responsive as well.\n\nIf the service supports TLS Edge Termination, this endpoint does not require the\n`X-Forwarded-Proto` header to be set.\n\nBe aware that if you are running multiple nodes of this service, the health status will never\nrefer to the cluster state, only to a single instance.", - "produces": [ - "application/json" - ], - "tags": [ - "api" - ], + "produces": ["application/json"], + "tags": ["api"], "summary": "Check readiness status", "operationId": "isInstanceReady", "responses": { @@ -303,19 +276,10 @@ "/rules": { "get": { "description": "This method returns an array of all rules that are stored in the backend. This is useful if you want to get a full\nview of what rules you have currently in place.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "http", - "https" - ], - "tags": [ - "api" - ], + "consumes": ["application/json"], + "produces": ["application/json"], + "schemes": ["http", "https"], + "tags": ["api"], "summary": "List all rules", "operationId": "listRules", "parameters": [ @@ -381,19 +345,10 @@ "/rules/{id}": { "get": { "description": "Use this method to retrieve a rule from the storage. If it does not exist you will receive a 404 error.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "http", - "https" - ], - "tags": [ - "api" - ], + "consumes": ["application/json"], + "produces": ["application/json"], + "schemes": ["http", "https"], + "tags": ["api"], "summary": "Retrieve a rule", "operationId": "getRule", "parameters": [ @@ -479,12 +434,8 @@ "/version": { "get": { "description": "This endpoint returns the service version typically notated using semantic versioning.\n\nIf the service supports TLS Edge Termination, this endpoint does not require the\n`X-Forwarded-Proto` header to be set.\n\nBe aware that if you are running multiple nodes of this service, the health status will never\nrefer to the cluster state, only to a single instance.", - "produces": [ - "application/json" - ], - "tags": [ - "api" - ], + "produces": ["application/json"], + "tags": ["api"], "summary": "Get service version", "operationId": "getVersion", "responses": { @@ -691,4 +642,4 @@ }, "x-forwarded-proto": "string", "x-request-id": "string" -} \ No newline at end of file +} diff --git a/.schema/config.schema.json b/.schema/config.schema.json index 6559d74303..c22d6de9c9 100644 --- a/.schema/config.schema.json +++ b/.schema/config.schema.json @@ -16,11 +16,7 @@ "default": "5s", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "description": "The maximum duration for reading the entire request, including the body.", - "examples": [ - "5s", - "5m", - "5h" - ] + "examples": ["5s", "5m", "5h"] }, "write": { "title": "HTTP Write Timeout", @@ -28,11 +24,7 @@ "default": "120s", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "description": "The maximum duration before timing out writes of the response. Increase this parameter to prevent unexpected closing a client connection if an upstream request is responding slowly.", - "examples": [ - "5s", - "5m", - "5h" - ] + "examples": ["5s", "5m", "5h"] }, "idle": { "title": "HTTP Idle Timeout", @@ -40,11 +32,7 @@ "default": "120s", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "description": " The maximum amount of time to wait for any action of a request session, reading data or writing the response.", - "examples": [ - "5s", - "5m", - "5h" - ] + "examples": ["5s", "5m", "5h"] } } }, @@ -71,9 +59,7 @@ "path": { "title": "Path to PEM-encoded Fle", "type": "string", - "examples": [ - "path/to/file.pem" - ] + "examples": ["path/to/file.pem"] }, "base64": { "title": "Base64 Encoded Inline", @@ -128,9 +114,7 @@ "type": "string", "minLength": 1 }, - "default": [ - "*" - ], + "default": ["*"], "uniqueItems": true, "examples": [ [ @@ -158,13 +142,7 @@ ] }, "uniqueItems": true, - "default": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE" - ] + "default": ["GET", "POST", "PUT", "PATCH", "DELETE"] }, "allowed_headers": { "description": "A list of non simple headers the client is allowed to use with cross-domain requests.", @@ -175,10 +153,7 @@ }, "minLength": 1, "uniqueItems": true, - "default": [ - "Authorization", - "Content-Type" - ] + "default": ["Authorization", "Content-Type"] }, "exposed_headers": { "description": "Indicates which headers are safe to expose to the API of a CORS API specification", @@ -189,9 +164,7 @@ }, "minLength": 1, "uniqueItems": true, - "default": [ - "Content-Type" - ] + "default": ["Content-Type"] }, "allow_credentials": { "type": "boolean", @@ -218,20 +191,13 @@ "title": "Enabled", "type": "boolean", "default": false, - "examples": [ - true - ], + "examples": [true], "description": "En-/disables this component." }, "scopeStrategy": { "title": "Scope Strategy", "type": "string", - "enum": [ - "hierarchic", - "exact", - "wildcard", - "none" - ], + "enum": ["hierarchic", "exact", "wildcard", "none"], "default": "none", "description": "Sets the strategy validation algorithm." }, @@ -240,9 +206,7 @@ "title": "HTTP Redirect Error Handler", "description": "This section is optional when the error handler is disabled.", "additionalProperties": false, - "required": [ - "to" - ], + "required": ["to"], "properties": { "to": { "title": "Redirect to", @@ -259,10 +223,7 @@ "title": "HTTP Redirect Status Code", "description": "Defines the HTTP Redirect status code which can bei 301 (Moved Permanently) or 302 (Found).", "type": "integer", - "enum": [ - 301, - 302 - ], + "enum": [301, 302], "default": 302 }, "return_to_query_param": { @@ -386,11 +347,7 @@ "subject": { "type": "string", "title": "Anonymous Subject", - "examples": [ - "guest", - "anon", - "unknown" - ], + "examples": ["guest", "anon", "unknown"], "default": "anonymous", "description": "Sets the anonymous username." } @@ -407,9 +364,7 @@ "type": "string", "format": "uri", "description": "The origin to proxy requests to. If the response is a 200 with body `{ \"subject\": \"...\", \"extra\": {} }`. The request will pass the subject through successfully, otherwise it will be marked as unauthorized.\n\n>If this authenticator is enabled, this value is required.", - "examples": [ - "https://session-store-host" - ] + "examples": ["https://session-store-host"] }, "only": { "type": "array", @@ -440,10 +395,7 @@ "title": "Force HTTP Method", "type": "string", "description": "When set uses the given HTTP method instead of the request HTTP method.", - "examples": [ - "GET", - "POST" - ] + "examples": ["GET", "POST"] }, "additional_headers": { "title": "Set Additional HTTP Headers", @@ -466,9 +418,7 @@ "default": "subject" } }, - "required": [ - "check_session_url" - ], + "required": ["check_session_url"], "additionalProperties": false }, "configAuthenticatorsBearerToken": { @@ -481,9 +431,7 @@ "type": "string", "format": "uri", "description": "The origin to proxy requests to. If the response is a 200 with body `{ \"subject\": \"...\", \"extra\": {} }`. The request will pass the subject through successfully, otherwise it will be marked as unauthorized.\n\n>If this authenticator is enabled, this value is required.", - "examples": [ - "https://session-store-host" - ] + "examples": ["https://session-store-host"] }, "token_from": { "title": "Token From", @@ -547,10 +495,7 @@ "title": "Force HTTP Method", "type": "string", "description": "When set uses the given HTTP method instead of the request HTTP method.", - "examples": [ - "GET", - "POST" - ] + "examples": ["GET", "POST"] }, "additional_headers": { "title": "Set Additional HTTP Headers", @@ -573,18 +518,14 @@ "default": "sub" } }, - "required": [ - "check_session_url" - ], + "required": ["check_session_url"], "additionalProperties": false }, "configAuthenticatorsJwt": { "type": "object", "title": "JWT Authenticator Configuration", "description": "This section is optional when the authenticator is disabled.", - "required": [ - "jwks_urls" - ], + "required": ["jwks_urls"], "properties": { "required_scope": { "type": "array", @@ -635,20 +576,14 @@ "type": "string", "description": "The configuration which sets the max wait threshold when fetching new JWKs", "default": "1s", - "examples": [ - "100ms", - "1s" - ] + "examples": ["100ms", "1s"] }, "jwks_ttl": { "title": "JWK cache TTL configuration", "type": "string", "description": "The time interval for which fetched JWKs are cached", "default": "30s", - "examples": [ - "30m", - "6h" - ] + "examples": ["30m", "6h"] }, "scope_strategy": { "$ref": "#/definitions/scopeStrategy" @@ -707,9 +642,7 @@ "type": "string", "description": "The OAuth 2.0 Token Endpoint that will be used to validate the client credentials.\n\n>If this authenticator is enabled, this value is required.", "format": "uri", - "examples": [ - "https://my-website.com/oauth2/token" - ] + "examples": ["https://my-website.com/oauth2/token"] }, "required_scope": { "type": "array", @@ -734,9 +667,7 @@ "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "title": "Cache Time to Live", "description": "Can override the default behaviour of using the token exp time, and specify a set time to live for the token in the cache. If the token exp time is lower than the set value the token exp time will be used instead.", - "examples": [ - "5s" - ] + "examples": ["5s"] }, "max_tokens": { "type": "integer", @@ -747,9 +678,7 @@ } } }, - "required": [ - "token_url" - ], + "required": ["token_url"], "additionalProperties": false }, "configAuthenticatorsOauth2Introspection": { @@ -760,9 +689,7 @@ "introspection_url": { "type": "string", "format": "uri", - "examples": [ - "https://my-website.com/oauth2/introspection" - ], + "examples": ["https://my-website.com/oauth2/introspection"], "title": "OAuth 2.0 Introspection URL", "description": "The OAuth 2.0 Token Introspection endpoint URL.\n\n>If this authenticator is enabled, this value is required." }, @@ -800,10 +727,7 @@ "type": "string", "title": "OAuth 2.0 Audience", "description": "The OAuth 2.0 Audience to be requested during the OAuth 2.0 Client Credentials Grant.", - "examples": [ - "http://www.example.com", - "services:my-app" - ] + "examples": ["http://www.example.com", "services:my-app"] }, "scope": { "type": "array", @@ -812,12 +736,7 @@ }, "title": "OAuth 2.0 Scope", "description": "The OAuth 2.0 Scope to be requested during the OAuth 2.0 Client Credentials Grant.", - "examples": [ - [ - "foo", - "bar" - ] - ] + "examples": [["foo", "bar"]] } }, "oneOf": [ @@ -829,11 +748,7 @@ } }, { - "required": [ - "client_id", - "client_secret", - "token_url" - ], + "required": ["client_id", "client_secret", "token_url"], "properties": { "enabled": { "const": true @@ -861,12 +776,7 @@ }, "title": "OAuth 2.0 Scope", "description": "The OAuth 2.0 Scope to be requested during the OAuth 2.0 Client Credentials Grant.", - "examples": [ - [ - "foo", - "bar" - ] - ] + "examples": [["foo", "bar"]] } } } @@ -958,9 +868,7 @@ "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "title": "Cache Time to Live", "description": "Can override the default behaviour of using the token exp time, and specify a set time to live for the token in the cache.", - "examples": [ - "5s" - ] + "examples": ["5s"] }, "max_cost": { "type": "integer", @@ -971,9 +879,7 @@ } } }, - "required": [ - "introspection_url" - ], + "required": ["introspection_url"], "additionalProperties": false }, "configAuthorizersKetoEngineAcpOry": { @@ -986,9 +892,7 @@ "type": "string", "format": "uri", "description": "The base URL of ORY Keto.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "http://my-keto/" - ] + "examples": ["http://my-keto/"] }, "required_action": { "type": "string" @@ -1003,11 +907,7 @@ "type": "string" } }, - "required": [ - "base_url", - "required_action", - "required_resource" - ], + "required": ["base_url", "required_action", "required_resource"], "additionalProperties": false }, "configAuthorizersRemote": { @@ -1020,9 +920,7 @@ "type": "string", "format": "uri", "description": "The URL of the remote authorizer. The remote authorizer is expected to return either 200 OK or 403 Forbidden to allow/deny access.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "https://host/path" - ] + "examples": ["https://host/path"] }, "headers": { "type": "object", @@ -1045,9 +943,7 @@ "$ref": "#/definitions/retry" } }, - "required": [ - "remote" - ], + "required": ["remote"], "additionalProperties": false }, "configAuthorizersRemoteJSON": { @@ -1060,17 +956,13 @@ "type": "string", "format": "uri", "description": "The URL of the remote authorizer. The remote authorizer is expected to return either 200 OK or 403 Forbidden to allow/deny access.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "https://host/path" - ] + "examples": ["https://host/path"] }, "payload": { "title": "JSON Payload", "type": "string", "description": "The JSON payload of the request sent to the remote authorizer. The string will be parsed by the Go text/template package and applied to an AuthenticationSession object.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "{\"subject\":\"{{ .Subject }}\"}" - ] + "examples": ["{\"subject\":\"{{ .Subject }}\"}"] }, "forward_response_headers_to_upstream": { "description": "A list of non simple headers the remote is allowed to return to mutate requests.", @@ -1087,19 +979,14 @@ "$ref": "#/definitions/retry" } }, - "required": [ - "remote", - "payload" - ], + "required": ["remote", "payload"], "additionalProperties": false }, "configMutatorsCookie": { "type": "object", "title": "Cookie Mutator Configuration", "description": "This section is optional when the mutator is disabled.", - "required": [ - "cookies" - ], + "required": ["cookies"], "properties": { "cookies": { "type": "object", @@ -1114,9 +1001,7 @@ "type": "object", "title": "Header Mutator Configuration", "description": "This section is optional when the mutator is disabled.", - "required": [ - "headers" - ], + "required": ["headers"], "properties": { "headers": { "type": "object", @@ -1134,9 +1019,7 @@ "properties": { "api": { "additionalProperties": false, - "required": [ - "url" - ], + "required": ["url"], "type": "object", "properties": { "url": { @@ -1148,10 +1031,7 @@ "additionalProperties": false, "properties": { "basic": { - "required": [ - "username", - "password" - ], + "required": ["username", "password"], "type": "object", "additionalProperties": false, "properties": { @@ -1187,19 +1067,14 @@ } } }, - "required": [ - "api" - ], + "required": ["api"], "additionalProperties": false }, "configMutatorsIdToken": { "type": "object", "title": "ID Token Mutator Configuration", "description": "This section is optional when the mutator is disabled.", - "required": [ - "jwks_url", - "issuer_url" - ], + "required": ["jwks_url", "issuer_url"], "properties": { "claims": { "type": "string" @@ -1226,11 +1101,7 @@ "description": "Sets the time-to-live of the JSON Web Token.", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "default": "15m", - "examples": [ - "1h", - "1m", - "30s" - ] + "examples": ["1h", "1m", "30s"] } }, "additionalProperties": false @@ -1256,10 +1127,7 @@ "host": { "type": "string", "default": "", - "examples": [ - "localhost", - "127.0.0.1" - ], + "examples": ["localhost", "127.0.0.1"], "title": "Host", "description": "The network interface to listen on." }, @@ -1288,10 +1156,7 @@ "host": { "type": "string", "default": "", - "examples": [ - "localhost", - "127.0.0.1" - ], + "examples": ["localhost", "127.0.0.1"], "title": "Host", "description": "The network interface to listen on. Leave empty to listen on all interfaces." }, @@ -1320,10 +1185,7 @@ "host": { "type": "string", "default": "", - "examples": [ - "localhost", - "127.0.0.1" - ], + "examples": ["localhost", "127.0.0.1"], "title": "Host", "description": "The network interface to listen on. Leave empty to listen on all interfaces." }, @@ -1375,13 +1237,8 @@ "description": "This an optional field describing matching strategy. Currently supported values are 'glob' and 'regexp'.", "type": "string", "default": "regexp", - "enum": [ - "glob", - "regexp" - ], - "examples": [ - "glob" - ] + "enum": ["glob", "regexp"], + "examples": ["glob"] } } }, @@ -1446,9 +1303,7 @@ "$ref": "#/definitions/configAuthenticatorsCookieSession" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1478,9 +1333,7 @@ "$ref": "#/definitions/configAuthenticatorsBearerToken" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1510,9 +1363,7 @@ "$ref": "#/definitions/configAuthenticatorsJwt" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1542,9 +1393,7 @@ "$ref": "#/definitions/configAuthenticatorsOauth2ClientCredentials" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1574,9 +1423,7 @@ "$ref": "#/definitions/configAuthenticatorsOauth2Introspection" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1601,14 +1448,8 @@ "items": { "type": "string" }, - "default": [ - "json" - ], - "examples": [ - [ - "redirect" - ] - ] + "default": ["json"], + "examples": [["redirect"]] }, "handlers": { "additionalProperties": false, @@ -1634,9 +1475,7 @@ "$ref": "#/definitions/configErrorsWWWAuthenticate" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1666,9 +1505,7 @@ "$ref": "#/definitions/configErrorsRedirect" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1699,9 +1536,7 @@ "$ref": "#/definitions/configErrorsJSON" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1767,9 +1602,7 @@ "$ref": "#/definitions/configAuthorizersKetoEngineAcpOry" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1799,9 +1632,7 @@ "$ref": "#/definitions/configAuthorizersRemote" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1831,9 +1662,7 @@ "$ref": "#/definitions/configAuthorizersRemoteJSON" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1882,9 +1711,7 @@ "$ref": "#/definitions/configMutatorsCookie" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1914,9 +1741,7 @@ "$ref": "#/definitions/configMutatorsHeader" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1946,9 +1771,7 @@ "$ref": "#/definitions/configMutatorsHydrator" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1978,9 +1801,7 @@ "$ref": "#/definitions/configMutatorsIdToken" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -2003,22 +1824,13 @@ "provider": { "type": "string", "description": "Set this to the tracing backend you wish to use. Supports Jaeger, Zipkin, DataDog and elastic-apm. If omitted or empty, tracing will be disabled. Use environment variables to configure DataDog (see https://docs.datadoghq.com/tracing/setup/go/#configuration).", - "enum": [ - "zipkin", - "jaeger", - "datadog", - "elastic-apm" - ], - "examples": [ - "zipkin" - ] + "enum": ["zipkin", "jaeger", "datadog", "elastic-apm"], + "examples": ["zipkin"] }, "service_name": { "type": "string", "description": "Specifies the service name to use on the tracer.", - "examples": [ - "Ory Oathkeeper" - ] + "examples": ["Ory Oathkeeper"] }, "providers": { "type": "object", @@ -2060,16 +1872,12 @@ "format": "uri" } ], - "examples": [ - "127.0.0.1:6831" - ] + "examples": ["127.0.0.1:6831"] }, "propagation": { "type": "string", "description": "The tracing header format", - "examples": [ - "jaeger" - ] + "examples": ["jaeger"] }, "max_tag_value_length": { "type": "integer", @@ -2079,11 +1887,7 @@ "sampling": { "type": "object", "propertyNames": { - "enum": [ - "type", - "value", - "server_url" - ] + "enum": ["type", "value", "server_url"] }, "allOf": [ { @@ -2182,10 +1986,7 @@ "format": { "description": "The log format can either be text or JSON.", "type": "string", - "enum": [ - "json", - "text" - ] + "enum": ["json", "text"] } }, "additionalProperties": false @@ -2194,11 +1995,7 @@ "title": "Profiling", "description": "Enables CPU or memory profiling if set. For more details on profiling Go programs read [Profiling Go Programs](https://blog.golang.org/profiling-go-programs).", "type": "string", - "enum": [ - "cpu", - "mem", - "" - ] + "enum": ["cpu", "mem", ""] }, "version": { "type": "string", diff --git a/.schema/openapi/gen.typescript.yml b/.schema/openapi/gen.typescript.yml index 8030dff4ee..5b640545fe 100644 --- a/.schema/openapi/gen.typescript.yml +++ b/.schema/openapi/gen.typescript.yml @@ -1,4 +1,4 @@ -npmName: "@ory/kratos-client" +npmName: '@ory/kratos-client' npmVersion: 0.0.0 # typescriptThreePlus: true #npmRepository: https://github.com/ory/sdk.git diff --git a/.schema/openapi/patches/health.yaml b/.schema/openapi/patches/health.yaml index 1d42a1d63d..38e94c482d 100644 --- a/.schema/openapi/patches/health.yaml +++ b/.schema/openapi/patches/health.yaml @@ -17,16 +17,16 @@ content: application/json: schema: - "$ref": "#/components/schemas/healthStatus" - description: {{.ProjectHumanName}} is ready to accept connections. + '$ref': '#/components/schemas/healthStatus' + description: '{{.ProjectHumanName}} is ready to accept connections.' '500': content: application/json: schema: - "$ref": "#/components/schemas/genericError" + '$ref': '#/components/schemas/genericError' description: genericError summary: Check HTTP Server Status - tags: {{ .HealthPathTags | toJson }} + tags: { { .HealthPathTags | toJson } } - op: replace path: /paths/~1health~1ready value: @@ -51,7 +51,7 @@ status: description: Always "ok". type: string - description: {{.ProjectHumanName}} is ready to accept requests. + description: '{{.ProjectHumanName}} is ready to accept requests.' '503': content: application/json: @@ -60,12 +60,14 @@ errors: additionalProperties: type: string - description: Errors contains a list of errors that caused the not ready status. + description: + Errors contains a list of errors that caused the not ready + status. type: object type: object description: Ory Kratos is not yet ready to accept requests. summary: Check HTTP Server and Database Status - tags: {{ .HealthPathTags | toJson }} + tags: '{{ .HealthPathTags | toJson }}' - op: replace path: /paths/~1version value: @@ -91,4 +93,4 @@ type: string description: Returns the {{.ProjectHumanName}} version. summary: Return Running Software Version. - tags: {{ .HealthPathTags | toJson }} + tags: '{{ .HealthPathTags | toJson }}' diff --git a/.schema/openapi/patches/meta.yaml b/.schema/openapi/patches/meta.yaml index fd6d1fe182..0070bbb2db 100644 --- a/.schema/openapi/patches/meta.yaml +++ b/.schema/openapi/patches/meta.yaml @@ -9,4 +9,4 @@ license: name: Apache 2.0 contact: - email: "hi@ory.sh" + email: 'hi@ory.sh' diff --git a/.schema/openapi/templates/go/.travis.yml b/.schema/openapi/templates/go/.travis.yml index f5cb2ce9a5..755978dca7 100644 --- a/.schema/openapi/templates/go/.travis.yml +++ b/.schema/openapi/templates/go/.travis.yml @@ -5,4 +5,3 @@ install: script: - go build -v ./ - diff --git a/.schema/version.schema.json b/.schema/version.schema.json index 1a82a745e1..718dd5f491 100644 --- a/.schema/version.schema.json +++ b/.schema/version.schema.json @@ -12,9 +12,7 @@ "const": "v0.38.4-beta.1" } }, - "required": [ - "version" - ] + "required": ["version"] }, { "$ref": "https://raw.githubusercontent.com/ory/oathkeeper/v0.38.4-beta.1/.schema/config.schema.json" @@ -29,9 +27,7 @@ "const": "v0.38.5-beta.1" } }, - "required": [ - "version" - ] + "required": ["version"] }, { "$ref": "https://raw.githubusercontent.com/ory/oathkeeper/v0.38.5-beta.1/.schema/config.schema.json" @@ -46,9 +42,7 @@ "const": "v0.38.9-beta.1" } }, - "required": [ - "version" - ] + "required": ["version"] }, { "$ref": "https://raw.githubusercontent.com/ory/oathkeeper/v0.38.9-beta.1/.schema/config.schema.json" @@ -63,9 +57,7 @@ "const": "v0.38.14-beta.1" } }, - "required": [ - "version" - ] + "required": ["version"] }, { "$ref": "https://raw.githubusercontent.com/ory/oathkeeper/v0.38.14-beta.1/.schema/config.schema.json" @@ -80,9 +72,7 @@ "const": "v0.38.15-beta.1" } }, - "required": [ - "version" - ] + "required": ["version"] }, { "$ref": "https://raw.githubusercontent.com/ory/oathkeeper/v0.38.15-beta.1/.schema/config.schema.json" @@ -97,9 +87,7 @@ "const": "v0.38.17-beta.1" } }, - "required": [ - "version" - ] + "required": ["version"] }, { "$ref": "https://raw.githubusercontent.com/ory/oathkeeper/v0.38.17-beta.1/.schema/config.schema.json" @@ -114,9 +102,7 @@ "const": "v0.38.19-beta.1" } }, - "required": [ - "version" - ] + "required": ["version"] }, { "$ref": "https://raw.githubusercontent.com/ory/oathkeeper/v0.38.19-beta.1/.schema/config.schema.json" @@ -131,9 +117,7 @@ "const": "v0.38.20-beta.1" } }, - "required": [ - "version" - ] + "required": ["version"] }, { "$ref": "https://raw.githubusercontent.com/ory/oathkeeper/v0.38.20-beta.1/.schema/config.schema.json" @@ -152,18 +136,14 @@ "maxLength": 0 } }, - "required": [ - "version" - ] + "required": ["version"] }, { "not": { "properties": { "version": {} }, - "required": [ - "version" - ] + "required": ["version"] } } ] diff --git a/.schemas/authenticators.anonymous.schema.json b/.schemas/authenticators.anonymous.schema.json index b8fa24d84a..f9fd30e8d5 100644 --- a/.schemas/authenticators.anonymous.schema.json +++ b/.schemas/authenticators.anonymous.schema.json @@ -8,12 +8,7 @@ "subject": { "type": "string", "title": "Anonymous Subject", - "examples": [ - "guest", - "anon", - "anonymous", - "unknown" - ], + "examples": ["guest", "anon", "anonymous", "unknown"], "default": "anonymous", "description": "Sets the anonymous username." } diff --git a/.schemas/authenticators.cookie_session.schema.json b/.schemas/authenticators.cookie_session.schema.json index 5a7e10b965..ac609e6187 100644 --- a/.schemas/authenticators.cookie_session.schema.json +++ b/.schemas/authenticators.cookie_session.schema.json @@ -10,9 +10,7 @@ "type": "string", "format": "uri", "description": "The origin to proxy requests to. If the response is a 200 with body `{ \"subject\": \"...\", \"extra\": {} }`. The request will pass the subject through successfully, otherwise it will be marked as unauthorized.\n\n>If this authenticator is enabled, this value is required.", - "examples": [ - "https://session-store-host" - ] + "examples": ["https://session-store-host"] }, "only": { "type": "array", @@ -29,8 +27,6 @@ "description": "When set to true, any path specified in `check_session_url` will be preserved instead of overwriting the path with the path from the original request" } }, - "required": [ - "check_session_url" - ], + "required": ["check_session_url"], "additionalProperties": false } diff --git a/.schemas/authenticators.jwt.schema.json b/.schemas/authenticators.jwt.schema.json index ff8fe0d108..4526e01e31 100644 --- a/.schemas/authenticators.jwt.schema.json +++ b/.schemas/authenticators.jwt.schema.json @@ -51,21 +51,15 @@ "title": "Max await interval for the JWK fetch", "type": "string", "description": "The configuration which sets the max wait threshold when fetching new JWKs", - "default" : "1s", - "examples": [ - "100ms", - "1s" - ] + "default": "1s", + "examples": ["100ms", "1s"] }, "jwks_ttl": { "title": "JWK cache TTL configuration", "type": "string", "description": "The time interval for which fetched JWKs are cached", - "default" : "30s", - "examples": [ - "30m", - "6h" - ] + "default": "30s", + "examples": ["30m", "6h"] }, "scope_strategy": { "$ref": "https://raw.githubusercontent.com/ory/oathkeeper/master/.schemas/scope_strategy.schema.json#" @@ -76,9 +70,7 @@ "oneOf": [ { "type": "object", - "required": [ - "header" - ], + "required": ["header"], "properties": { "header": { "title": "Header", @@ -89,9 +81,7 @@ }, { "type": "object", - "required": [ - "query_parameter" - ], + "required": ["query_parameter"], "properties": { "query_parameter": { "title": "Query Parameter", @@ -102,9 +92,7 @@ }, { "type": "object", - "required": [ - "cookie" - ], + "required": ["cookie"], "properties": { "cookie": { "title": "Cookie", diff --git a/.schemas/authenticators.noop.schema.json b/.schemas/authenticators.noop.schema.json index 860805a40d..34aa1c3892 100644 --- a/.schemas/authenticators.noop.schema.json +++ b/.schemas/authenticators.noop.schema.json @@ -4,7 +4,6 @@ "type": "object", "title": "NoOp Authenticator Configuration", "description": "This section is optional when the authenticator is disabled.", - "properties": { - }, + "properties": {}, "additionalProperties": false } diff --git a/.schemas/authenticators.oauth2_client_credentials.schema.json b/.schemas/authenticators.oauth2_client_credentials.schema.json index a6072bba9f..19578bdba3 100644 --- a/.schemas/authenticators.oauth2_client_credentials.schema.json +++ b/.schemas/authenticators.oauth2_client_credentials.schema.json @@ -9,9 +9,7 @@ "type": "string", "description": "The OAuth 2.0 Token Endpoint that will be used to validate the client credentials.\n\n>If this authenticator is enabled, this value is required.", "format": "uri", - "examples": [ - "https://my-website.com/oauth2/token" - ] + "examples": ["https://my-website.com/oauth2/token"] }, "required_scope": { "type": "array", diff --git a/.schemas/authenticators.oauth2_introspection.schema.json b/.schemas/authenticators.oauth2_introspection.schema.json index 6740b70c71..78e16bfebd 100644 --- a/.schemas/authenticators.oauth2_introspection.schema.json +++ b/.schemas/authenticators.oauth2_introspection.schema.json @@ -8,9 +8,7 @@ "introspection_url": { "type": "string", "format": "uri", - "examples": [ - "https://my-website.com/oauth2/introspection" - ], + "examples": ["https://my-website.com/oauth2/introspection"], "title": "OAuth 2.0 Introspection URL", "description": "The OAuth 2.0 Token Introspection endpoint URL.\n\n>If this authenticator is enabled, this value is required." }, @@ -34,11 +32,7 @@ { "type": "object", "additionalProperties": false, - "required": [ - "client_id", - "client_secret", - "token_url" - ], + "required": ["client_id", "client_secret", "token_url"], "properties": { "enabled": { "title": "Enabled", @@ -65,10 +59,7 @@ "type": "string", "title": "OAuth 2.0 Audience", "description": "The OAuth 2.0 Audience to be requested during the OAuth 2.0 Client Credentials Grant.", - "examples": [ - "http://www.example.com", - "services:my-app" - ] + "examples": ["http://www.example.com", "services:my-app"] }, "scope": { "type": "array", @@ -77,11 +68,7 @@ }, "title": "OAuth 2.0 Scope", "description": "The OAuth 2.0 Scope to be requested during the OAuth 2.0 Client Credentials Grant.", - "examples": [ - [ - "[\"foo\", \"bar\"]" - ] - ] + "examples": [["[\"foo\", \"bar\"]"]] } } } @@ -117,9 +104,7 @@ "oneOf": [ { "type": "object", - "required": [ - "header" - ], + "required": ["header"], "properties": { "header": { "title": "Header", @@ -130,9 +115,7 @@ }, { "type": "object", - "required": [ - "query_parameter" - ], + "required": ["query_parameter"], "properties": { "query_parameter": { "title": "Query Parameter", @@ -143,9 +126,7 @@ }, { "type": "object", - "required": [ - "cookie" - ], + "required": ["cookie"], "properties": { "cookie": { "title": "Cookie", @@ -157,8 +138,6 @@ ] } }, - "required": [ - "introspection_url" - ], + "required": ["introspection_url"], "additionalProperties": false } diff --git a/.schemas/authenticators.unauthorized.schema.json b/.schemas/authenticators.unauthorized.schema.json index 613b2961d2..8bf1fbcd3a 100644 --- a/.schemas/authenticators.unauthorized.schema.json +++ b/.schemas/authenticators.unauthorized.schema.json @@ -4,7 +4,6 @@ "type": "object", "title": "Unauthorized Authenticator Configuration", "description": "This section is optional when the authenticator is disabled.", - "properties": { - }, + "properties": {}, "additionalProperties": false } diff --git a/.schemas/authorizers.allow.schema.json b/.schemas/authorizers.allow.schema.json index 9471a8ddc5..67a7e14516 100644 --- a/.schemas/authorizers.allow.schema.json +++ b/.schemas/authorizers.allow.schema.json @@ -4,7 +4,6 @@ "type": "object", "title": "Allow Authorizer Configuration", "description": "This section is optional when the authorizer is disabled.", - "properties": { - }, + "properties": {}, "additionalProperties": false } diff --git a/.schemas/authorizers.deny.schema.json b/.schemas/authorizers.deny.schema.json index ba2690a8f7..5298de17ef 100644 --- a/.schemas/authorizers.deny.schema.json +++ b/.schemas/authorizers.deny.schema.json @@ -4,7 +4,6 @@ "type": "object", "title": "Deny Authorizer Configuration", "description": "This section is optional when the authorizer is disabled.", - "properties": { - }, + "properties": {}, "additionalProperties": false } diff --git a/.schemas/authorizers.keto_engine_acp_ory.schema.json b/.schemas/authorizers.keto_engine_acp_ory.schema.json index 4f7c59d9f6..f837159ea9 100644 --- a/.schemas/authorizers.keto_engine_acp_ory.schema.json +++ b/.schemas/authorizers.keto_engine_acp_ory.schema.json @@ -10,9 +10,7 @@ "type": "string", "format": "uri", "description": "The base URL of ORY Keto.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "http://my-keto/" - ] + "examples": ["http://my-keto/"] }, "required_action": { "type": "string" @@ -27,10 +25,6 @@ "type": "string" } }, - "required": [ - "base_url", - "required_action", - "required_resource" - ], + "required": ["base_url", "required_action", "required_resource"], "additionalProperties": false } diff --git a/.schemas/authorizers.remote_json.schema.json b/.schemas/authorizers.remote_json.schema.json index 766c888d19..592504ef1d 100644 --- a/.schemas/authorizers.remote_json.schema.json +++ b/.schemas/authorizers.remote_json.schema.json @@ -10,33 +10,24 @@ "type": "string", "format": "uri", "description": "The URL of the remote authorizer. The remote authorizer is expected to return either 200 OK or 403 Forbidden to allow/deny access.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "https://host/path" - ] + "examples": ["https://host/path"] }, "payload": { "title": "JSON Payload", "type": "string", "description": "The JSON payload of the request sent to the remote authorizer. The string will be parsed by the Go text/template package and applied to an AuthenticationSession object.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "{\"subject\":\"{{ .Subject }}\"}" - ] + "examples": ["{\"subject\":\"{{ .Subject }}\"}"] }, - "forward_response_headers_to_upstream": { + "forward_response_headers_to_upstream": { "title": "Allowed Remote HTTP Headers for his Responses", "type": "array", "items": { "type": "string" }, "description": "A list of non simple headers the remote is allowed to return to mutate requests.", - "examples": [ - "X-Foo" - ] + "examples": ["X-Foo"] } }, - "required": [ - "remote", - "payload" - ], + "required": ["remote", "payload"], "additionalProperties": false } diff --git a/.schemas/config.schema.json b/.schemas/config.schema.json index 0d521b4986..216788c8cd 100644 --- a/.schemas/config.schema.json +++ b/.schemas/config.schema.json @@ -27,9 +27,7 @@ "path": { "title": "Path to PEM-encoded Fle", "type": "string", - "examples": [ - "path/to/file.pem" - ] + "examples": ["path/to/file.pem"] }, "base64": { "title": "Base64 Encoded Inline", @@ -84,9 +82,7 @@ "type": "string", "minLength": 1 }, - "default": [ - "*" - ], + "default": ["*"], "uniqueItems": true, "examples": [ [ @@ -114,13 +110,7 @@ ] }, "uniqueItems": true, - "default": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE" - ] + "default": ["GET", "POST", "PUT", "PATCH", "DELETE"] }, "allowed_headers": { "description": "A list of non simple headers the client is allowed to use with cross-domain requests.", @@ -131,10 +121,7 @@ }, "minLength": 1, "uniqueItems": true, - "default": [ - "Authorization", - "Content-Type" - ] + "default": ["Authorization", "Content-Type"] }, "exposed_headers": { "description": "Indicates which headers are safe to expose to the API of a CORS API specification", @@ -145,9 +132,7 @@ }, "minLength": 1, "uniqueItems": true, - "default": [ - "Content-Type" - ] + "default": ["Content-Type"] }, "allow_credentials": { "type": "boolean", @@ -174,20 +159,13 @@ "title": "Enabled", "type": "boolean", "default": false, - "examples": [ - true - ], + "examples": [true], "description": "En-/disables this component." }, "scopeStrategy": { "title": "Scope Strategy", "type": "string", - "enum": [ - "hierarchic", - "exact", - "wildcard", - "none" - ], + "enum": ["hierarchic", "exact", "wildcard", "none"], "default": "none", "description": "Sets the strategy validation algorithm." }, @@ -196,9 +174,7 @@ "title": "HTTP Redirect Error Handler", "description": "This section is optional when the error handler is disabled.", "additionalProperties": false, - "required": [ - "to" - ], + "required": ["to"], "properties": { "to": { "title": "Redirect to", @@ -210,10 +186,7 @@ "title": "HTTP Redirect Status Code", "description": "Defines the HTTP Redirect status code which can bei 301 (Moved Permanently) or 302 (Found).", "type": "integer", - "enum": [ - 301, - 302 - ], + "enum": [301, 302], "default": 302 }, "when": { @@ -330,11 +303,7 @@ "subject": { "type": "string", "title": "Anonymous Subject", - "examples": [ - "guest", - "anon", - "unknown" - ], + "examples": ["guest", "anon", "unknown"], "default": "anonymous", "description": "Sets the anonymous username." } @@ -351,9 +320,7 @@ "type": "string", "format": "uri", "description": "The origin to proxy requests to. If the response is a 200 with body `{ \"subject\": \"...\", \"extra\": {} }`. The request will pass the subject through successfully, otherwise it will be marked as unauthorized.\n\n>If this authenticator is enabled, this value is required.", - "examples": [ - "https://session-store-host" - ] + "examples": ["https://session-store-host"] }, "only": { "type": "array", @@ -382,18 +349,14 @@ "default": "subject" } }, - "required": [ - "check_session_url" - ], + "required": ["check_session_url"], "additionalProperties": false }, "configAuthenticatorsJwt": { "type": "object", "title": "JWT Authenticator Configuration", "description": "This section is optional when the authenticator is disabled.", - "required": [ - "jwks_urls" - ], + "required": ["jwks_urls"], "properties": { "required_scope": { "type": "array", @@ -443,21 +406,15 @@ "title": "Max await interval for the JWK fetch", "type": "string", "description": "The configuration which sets the max wait threshold when fetching new JWKs", - "default" : "1s", - "examples": [ - "100ms", - "1s" - ] + "default": "1s", + "examples": ["100ms", "1s"] }, "jwks_ttl": { "title": "JWK cache TTL configuration", "type": "string", "description": "The time interval for which fetched JWKs are cached", - "default" : "30s", - "examples": [ - "30m", - "6h" - ] + "default": "30s", + "examples": ["30m", "6h"] }, "scope_strategy": { "$ref": "#/definitions/scopeStrategy" @@ -516,9 +473,7 @@ "type": "string", "description": "The OAuth 2.0 Token Endpoint that will be used to validate the client credentials.\n\n>If this authenticator is enabled, this value is required.", "format": "uri", - "examples": [ - "https://my-website.com/oauth2/token" - ] + "examples": ["https://my-website.com/oauth2/token"] }, "required_scope": { "type": "array", @@ -532,9 +487,7 @@ "$ref": "#/definitions/retry" } }, - "required": [ - "token_url" - ], + "required": ["token_url"], "additionalProperties": false }, "configAuthenticatorsOauth2Introspection": { @@ -545,9 +498,7 @@ "introspection_url": { "type": "string", "format": "uri", - "examples": [ - "https://my-website.com/oauth2/introspection" - ], + "examples": ["https://my-website.com/oauth2/introspection"], "title": "OAuth 2.0 Introspection URL", "description": "The OAuth 2.0 Token Introspection endpoint URL.\n\n>If this authenticator is enabled, this value is required." }, @@ -585,10 +536,7 @@ "type": "string", "title": "OAuth 2.0 Audience", "description": "The OAuth 2.0 Audience to be requested during the OAuth 2.0 Client Credentials Grant.", - "examples": [ - "http://www.example.com", - "services:my-app" - ] + "examples": ["http://www.example.com", "services:my-app"] }, "scope": { "type": "array", @@ -597,12 +545,7 @@ }, "title": "OAuth 2.0 Scope", "description": "The OAuth 2.0 Scope to be requested during the OAuth 2.0 Client Credentials Grant.", - "examples": [ - [ - "foo", - "bar" - ] - ] + "examples": [["foo", "bar"]] } }, "oneOf": [ @@ -614,11 +557,7 @@ } }, { - "required": [ - "client_id", - "client_secret", - "token_url" - ], + "required": ["client_id", "client_secret", "token_url"], "properties": { "enabled": { "const": true @@ -646,12 +585,7 @@ }, "title": "OAuth 2.0 Scope", "description": "The OAuth 2.0 Scope to be requested during the OAuth 2.0 Client Credentials Grant.", - "examples": [ - [ - "foo", - "bar" - ] - ] + "examples": [["foo", "bar"]] } } } @@ -732,9 +666,7 @@ "$ref": "#/definitions/retry" } }, - "required": [ - "introspection_url" - ], + "required": ["introspection_url"], "additionalProperties": false }, "configAuthorizersKetoEngineAcpOry": { @@ -747,9 +679,7 @@ "type": "string", "format": "uri", "description": "The base URL of ORY Keto.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "http://my-keto/" - ] + "examples": ["http://my-keto/"] }, "required_action": { "type": "string" @@ -764,11 +694,7 @@ "type": "string" } }, - "required": [ - "base_url", - "required_action", - "required_resource" - ], + "required": ["base_url", "required_action", "required_resource"], "additionalProperties": false }, "configAuthorizersRemoteJSON": { @@ -781,32 +707,23 @@ "type": "string", "format": "uri", "description": "The URL of the remote authorizer. The remote authorizer is expected to return either 200 OK or 403 Forbidden to allow/deny access.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "https://host/path" - ] + "examples": ["https://host/path"] }, "payload": { "title": "JSON Payload", "type": "string", "description": "The JSON payload of the request sent to the remote authorizer. The string will be parsed by the Go text/template package and applied to an AuthenticationSession object.\n\n>If this authorizer is enabled, this value is required.", - "examples": [ - "{\"subject\":\"{{ .Subject }}\"}" - ] + "examples": ["{\"subject\":\"{{ .Subject }}\"}"] } }, - "required": [ - "remote", - "payload" - ], + "required": ["remote", "payload"], "additionalProperties": false }, "configMutatorsCookie": { "type": "object", "title": "Cookie Mutator Configuration", "description": "This section is optional when the mutator is disabled.", - "required": [ - "cookies" - ], + "required": ["cookies"], "properties": { "cookies": { "type": "object", @@ -821,9 +738,7 @@ "type": "object", "title": "Header Mutator Configuration", "description": "This section is optional when the mutator is disabled.", - "required": [ - "headers" - ], + "required": ["headers"], "properties": { "headers": { "type": "object", @@ -841,9 +756,7 @@ "properties": { "api": { "additionalProperties": false, - "required": [ - "url" - ], + "required": ["url"], "type": "object", "properties": { "url": { @@ -855,10 +768,7 @@ "additionalProperties": false, "properties": { "basic": { - "required": [ - "username", - "password" - ], + "required": ["username", "password"], "type": "object", "additionalProperties": false, "properties": { @@ -878,19 +788,14 @@ } } }, - "required": [ - "api" - ], + "required": ["api"], "additionalProperties": false }, "configMutatorsIdToken": { "type": "object", "title": "ID Token Mutator Configuration", "description": "This section is optional when the mutator is disabled.", - "required": [ - "jwks_url", - "issuer_url" - ], + "required": ["jwks_url", "issuer_url"], "properties": { "claims": { "type": "string" @@ -917,11 +822,7 @@ "description": "Sets the time-to-live of the JSON Web Token.", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "default": "15m", - "examples": [ - "1h", - "1m", - "30s" - ] + "examples": ["1h", "1m", "30s"] } }, "additionalProperties": false @@ -947,10 +848,7 @@ "host": { "type": "string", "default": "", - "examples": [ - "localhost", - "127.0.0.1" - ], + "examples": ["localhost", "127.0.0.1"], "title": "Host", "description": "The network interface to listen on." }, @@ -976,10 +874,7 @@ "host": { "type": "string", "default": "", - "examples": [ - "localhost", - "127.0.0.1" - ], + "examples": ["localhost", "127.0.0.1"], "title": "Host", "description": "The network interface to listen on. Leave empty to listen on all interfaces." }, @@ -995,11 +890,7 @@ "default": "5s", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "description": "The maximum duration for reading the entire request, including the body.", - "examples": [ - "5s", - "5m", - "5h" - ] + "examples": ["5s", "5m", "5h"] }, "write": { "title": "HTTP Write Timeout", @@ -1007,11 +898,7 @@ "default": "120s", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "description": "The maximum duration before timing out writes of the response. Increase this parameter to prevent unexpected closing a client connection if an upstream request is responding slowly.", - "examples": [ - "5s", - "5m", - "5h" - ] + "examples": ["5s", "5m", "5h"] }, "idle": { "title": "HTTP Idle Timeout", @@ -1019,11 +906,7 @@ "default": "120s", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "description": " The maximum amount of time to wait for any action of a request session, reading data or writing the response.", - "examples": [ - "5s", - "5m", - "5h" - ] + "examples": ["5s", "5m", "5h"] } } }, @@ -1049,10 +932,7 @@ "host": { "type": "string", "default": "", - "examples": [ - "localhost", - "127.0.0.1" - ], + "examples": ["localhost", "127.0.0.1"], "title": "Host", "description": "The network interface to listen on. Leave empty to listen on all interfaces." }, @@ -1093,13 +973,8 @@ "description": "This an optional field describing matching strategy. Currently supported values are 'glob' and 'regexp'.", "type": "string", "default": "regexp", - "enum": [ - "glob", - "regexp" - ], - "examples": [ - "glob" - ] + "enum": ["glob", "regexp"], + "examples": ["glob"] } } }, @@ -1164,9 +1039,7 @@ "$ref": "#/definitions/configAuthenticatorsCookieSession" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1196,9 +1069,7 @@ "$ref": "#/definitions/configAuthenticatorsJwt" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1228,9 +1099,7 @@ "$ref": "#/definitions/configAuthenticatorsOauth2ClientCredentials" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1260,9 +1129,7 @@ "$ref": "#/definitions/configAuthenticatorsOauth2Introspection" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1287,14 +1154,8 @@ "items": { "type": "string" }, - "default": [ - "json" - ], - "examples": [ - [ - "redirect" - ] - ] + "default": ["json"], + "examples": [["redirect"]] }, "handlers": { "additionalProperties": false, @@ -1320,9 +1181,7 @@ "$ref": "#/definitions/configErrorsWWWAuthenticate" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1352,9 +1211,7 @@ "$ref": "#/definitions/configErrorsRedirect" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1385,9 +1242,7 @@ "$ref": "#/definitions/configErrorsJSON" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1453,9 +1308,7 @@ "$ref": "#/definitions/configAuthorizersKetoEngineAcpOry" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1485,9 +1338,7 @@ "$ref": "#/definitions/configAuthorizersRemoteJSON" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1536,9 +1387,7 @@ "$ref": "#/definitions/configMutatorsCookie" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1568,9 +1417,7 @@ "$ref": "#/definitions/configMutatorsHeader" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1600,9 +1447,7 @@ "$ref": "#/definitions/configMutatorsHydrator" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1632,9 +1477,7 @@ "$ref": "#/definitions/configMutatorsIdToken" } }, - "required": [ - "config" - ] + "required": ["config"] }, { "properties": { @@ -1655,24 +1498,14 @@ "level": { "type": "string", "default": "info", - "enum": [ - "panic", - "fatal", - "error", - "warn", - "info", - "debug" - ], + "enum": ["panic", "fatal", "error", "warn", "info", "debug"], "title": "Level", "description": "Debug enables stack traces on errors. Can also be set using environment variable LOG_LEVEL." }, "format": { "type": "string", "default": "text", - "enum": [ - "text", - "json" - ], + "enum": ["text", "json"], "title": "Format", "description": "The log format can either be text or JSON." } @@ -1683,11 +1516,7 @@ "title": "Profiling", "description": "Enables CPU or memory profiling if set. For more details on profiling Go programs read [Profiling Go Programs](https://blog.golang.org/profiling-go-programs).", "type": "string", - "enum": [ - "cpu", - "mem", - "" - ] + "enum": ["cpu", "mem", ""] } }, "required": [], diff --git a/.schemas/mutators.hydrator.schema.json b/.schemas/mutators.hydrator.schema.json index d0cb76a317..24ec133d31 100644 --- a/.schemas/mutators.hydrator.schema.json +++ b/.schemas/mutators.hydrator.schema.json @@ -7,9 +7,7 @@ "properties": { "api": { "additionalProperties": false, - "required": [ - "url" - ], + "required": ["url"], "type": "object", "properties": { "url": { @@ -21,10 +19,7 @@ "additionalProperties": false, "properties": { "basic": { - "required": [ - "username", - "password" - ], + "required": ["username", "password"], "type": "object", "additionalProperties": false, "properties": { @@ -57,8 +52,6 @@ } } }, - "required": [ - "api" - ], + "required": ["api"], "additionalProperties": false } diff --git a/.schemas/mutators.id_token.schema.json b/.schemas/mutators.id_token.schema.json index f4d113ded0..c160f0bc08 100644 --- a/.schemas/mutators.id_token.schema.json +++ b/.schemas/mutators.id_token.schema.json @@ -4,7 +4,7 @@ "type": "object", "title": "ID Token Mutator Configuration", "description": "This section is optional when the mutator is disabled.", - "required": ["jwks_url","issuer_url"], + "required": ["jwks_url", "issuer_url"], "properties": { "claims": { "type": "string" @@ -31,11 +31,7 @@ "description": "Sets the time-to-live of the JSON Web Token.", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", "default": "1m", - "examples": [ - "1h", - "1m", - "30s" - ] + "examples": ["1h", "1m", "30s"] } }, "additionalProperties": false diff --git a/.schemas/mutators.noop.schema.json b/.schemas/mutators.noop.schema.json index ee7fb89ad1..dc707bad7b 100644 --- a/.schemas/mutators.noop.schema.json +++ b/.schemas/mutators.noop.schema.json @@ -4,7 +4,6 @@ "type": "object", "title": "NoOp Mutator Configuration", "description": "This section is optional when the mutator is disabled.", - "properties": { - }, + "properties": {}, "additionalProperties": false } diff --git a/.schemas/scope_strategy.schema.json b/.schemas/scope_strategy.schema.json index 060834f2f8..cfd35c09dc 100644 --- a/.schemas/scope_strategy.schema.json +++ b/.schemas/scope_strategy.schema.json @@ -3,12 +3,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Scope Strategy", "type": "string", - "enum": [ - "hierarchic", - "exact", - "wildcard", - "none" - ], + "enum": ["hierarchic", "exact", "wildcard", "none"], "default": "none", "description": "Sets the strategy validation algorithm." } diff --git a/Makefile b/Makefile index 935f4568f0..8cac564f79 100644 --- a/Makefile +++ b/Makefile @@ -34,10 +34,6 @@ format: .bin/goimports node_modules bash <(curl https://raw.githubusercontent.com/ory/meta/master/install.sh) -b .bin ory v0.1.22 touch -a -m .bin/ory -# Generates the SDKs -.PHONY: sdk -sdk: .bin/packr2 .bin/swagger .bin/ory - # Generates the SDK .PHONY: sdk sdk: .bin/swagger .bin/ory node_modules diff --git a/README.md b/README.md index 349358ad6f..32fe801d9b 100644 --- a/README.md +++ b/README.md @@ -86,21 +86,17 @@ on Linux, macOS, Windows, and Docker and how to build ORY Oathkeeper from source -The Ory community stands on the shoulders of individuals, companies, and -maintainers. We thank everyone involved - from submitting bug reports and -feature requests, to contributing patches, to sponsoring our work. Our community -is 1000+ strong and growing rapidly. The Ory stack protects 16.000.000.000+ API -requests every month with over 250.000+ active service nodes. We would have +The Ory community stands on the shoulders of individuals, companies, and maintainers. We thank everyone involved - from submitting +bug reports and feature requests, to contributing patches, to sponsoring our work. Our community is 1000+ strong and growing +rapidly. The Ory stack protects 16.000.000.000+ API requests every month with over 250.000+ active service nodes. We would have never been able to achieve this without each and everyone of you! -The following list represents companies that have accompanied us along the way -and that have made outstanding contributions to our ecosystem. _If you think -that your company deserves a spot here, reach out to +The following list represents companies that have accompanied us along the way and that have made outstanding contributions to our +ecosystem. _If you think that your company deserves a spot here, reach out to office-muc@ory.sh now_! -**Please consider giving back by becoming a sponsor of our open source work on -Patreon or -Open Collective.** +**Please consider giving back by becoming a sponsor of our open source work on Patreon +or Open Collective.**