├── .bin ├── go-licenses ├── license-engine.sh ├── license-template-go.tpl ├── licenses └── list-licenses ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── BUG-REPORT.yml │ ├── DESIGN-DOC.yml │ ├── FEATURE-REQUEST.yml │ └── config.yml ├── auto_assign.yml ├── config.yml ├── pull_request_template.md └── workflows │ ├── closed_references.yml │ ├── conventional_commits.yml │ ├── labels.yml │ ├── licenses.yml │ └── stale.yml ├── .gitignore ├── .openapi-generator-ignore ├── .openapi-generator ├── FILES └── VERSION ├── .reference-ignore ├── .reports └── dep-licenses.csv ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── api └── openapi.yaml ├── api_api.go ├── api_health.go ├── api_version.go ├── client.go ├── configuration.go ├── docs ├── ApiAPI.md ├── GenericError.md ├── HealthAPI.md ├── HealthNotReadyStatus.md ├── HealthStatus.md ├── JsonWebKey.md ├── JsonWebKeySet.md ├── Rule.md ├── RuleHandler.md ├── RuleMatch.md ├── Upstream.md ├── Version.md └── VersionAPI.md ├── git_push.sh ├── go.mod ├── go.sum ├── model_generic_error.go ├── model_health_not_ready_status.go ├── model_health_status.go ├── model_json_web_key.go ├── model_json_web_key_set.go ├── model_rule.go ├── model_rule_handler.go ├── model_rule_match.go ├── model_upstream.go ├── model_version.go ├── response.go ├── test ├── api_api_test.go ├── api_health_test.go └── api_version_test.go └── utils.go /.bin/go-licenses: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ory/oathkeeper-client-go/e1be51ba50d11a0b93ff4244eda4c4b02dd10504/.bin/go-licenses -------------------------------------------------------------------------------- /.bin/license-engine.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script detects non-compliant licenses in the output of language-specific license checkers. 4 | 5 | # These licenses are allowed. 6 | # These are the exact and complete license strings for 100% legal certainty, no regexes. 7 | ALLOWED_LICENSES=( 8 | '0BSD' 9 | 'AFLv2.1' 10 | 'AFLv2.1,BSD' 11 | '(AFL-2.1 OR BSD-3-Clause)' 12 | 'Apache 2.0' 13 | 'Apache-2.0' 14 | '(Apache-2.0 OR MPL-1.1)' 15 | 'Apache-2.0 AND MIT' 16 | 'Apache License, Version 2.0' 17 | 'Apache*' 18 | 'Artistic-2.0' 19 | 'BlueOak-1.0.0' 20 | 'BSD' 21 | 'BSD*' 22 | 'BSD-2-Clause' 23 | '(BSD-2-Clause OR MIT OR Apache-2.0)' 24 | 'BSD-3-Clause' 25 | '(BSD-3-Clause OR GPL-2.0)' 26 | 'BSD-3-Clause OR MIT' 27 | '(BSD-3-Clause AND Apache-2.0)' 28 | 'CC0-1.0' 29 | 'CC-BY-3.0' 30 | 'CC-BY-4.0' 31 | '(CC-BY-4.0 AND MIT)' 32 | 'ISC' 33 | 'ISC*' 34 | 'LGPL-2.1' # LGPL allows commercial use, requires only that modifications to LGPL-protected libraries are published under a GPL-compatible license 35 | 'MIT' 36 | 'MIT*' 37 | 'MIT-0' 38 | 'MIT AND ISC' 39 | '(MIT AND BSD-3-Clause)' 40 | '(MIT AND Zlib)' 41 | '(MIT OR Apache-2.0)' 42 | '(MIT OR CC0-1.0)' 43 | '(MIT OR GPL-2.0)' 44 | 'MPL-2.0' 45 | '(MPL-2.0 OR Apache-2.0)' 46 | 'Public Domain' 47 | 'Python-2.0' # the Python-2.0 is a permissive license, see https://en.wikipedia.org/wiki/Python_License 48 | 'Unlicense' 49 | 'WTFPL' 50 | 'WTFPL OR ISC' 51 | '(WTFPL OR MIT)' 52 | '(MIT OR WTFPL)' 53 | 'LGPL-3.0-or-later' # Requires only that modifications to LGPL-protected libraries are published under a GPL-compatible license which is not the case at Ory 54 | ) 55 | 56 | # These modules don't work with the current license checkers 57 | # and have been manually verified to have a compatible license (regex format). 58 | APPROVED_MODULES=( 59 | 'https://github.com/ory-corp/cloud/' # Ory IP 60 | 'github.com/ory/hydra-client-go' # Apache-2.0 61 | 'github.com/ory/hydra-client-go/v2' # Apache-2.0 62 | 'github.com/ory/kratos-client-go' # Apache-2.0 63 | 'github.com/gobuffalo/github_flavored_markdown' # MIT 64 | 'buffers@0.1.1' # MIT: original source at http://github.com/substack/node-bufferlist is deleted but a fork at https://github.com/pkrumins/node-bufferlist/blob/master/LICENSE contains the original license by the original author (James Halliday) 65 | 'https://github.com/iconify/iconify/packages/react' # MIT: license is in root of monorepo at https://github.com/iconify/iconify/blob/main/license.txt 66 | 'github.com/gobuffalo/.*' # MIT: license is in root of monorepo at https://github.com/gobuffalo/github_flavored_markdown/blob/main/LICENSE 67 | 'github.com/ory-corp/cloud/.*' # Ory IP 68 | 'github.com/golang/freetype/.*' # FreeType license: https://freetype.sourceforge.net/FTL.TXT 69 | 'go.opentelemetry.io/otel/exporters/jaeger/internal/third_party/thrift/lib/go/thrift' # Incorrect detection, actually Apache-2.0: https://github.com/open-telemetry/opentelemetry-go/blob/exporters/jaeger/v1.17.0/exporters/jaeger/internal/third_party/thrift/LICENSE 70 | 'go.uber.org/zap/exp/.*' # MIT license is in root of exp folder in monorepo at https://github.com/uber-go/zap/blob/master/exp/LICENSE 71 | 'github.com/ory/client-go' # Apache-2.0 72 | 'github.com/ian-kent/linkio' # BSD - https://github.com/ian-kent/linkio/blob/97566b8728870dac1c9863ba5b0f237c39166879/linkio.go#L1-L3 73 | 'github.com/t-k/fluent-logger-golang/fluent' # Apache-2.0 https://github.com/t-k/fluent-logger-golang/blob/master/LICENSE 74 | 'github.com/jmespath/go-jmespath' # Apache-2.0 https://github.com/jmespath/go-jmespath/blob/master/LICENSE 75 | 'github.com/ory/keto/proto/ory/keto/opl/v1alpha1' # Apache-2.0 - submodule of keto 76 | 'github.com/ory/keto/proto/ory/keto/relation_tuples/v1alpha2' # Apache-2.0 - submodule of keto 77 | '@ory-corp/.*' # Ory IP 78 | 'github.com/apache/arrow/.*' # Apache-2.0 https://github.com/apache/arrow/blob/main/LICENSE.txt 79 | 'github.com/ory-corp/webhook-target' # Ory IP 80 | '@ory/keto-grpc-client.*' # Apache-2.0 - submodule of keto 81 | 'golden-fleece@1.0.9' # MIT: https://github.com/Rich-Harris/golden-fleece/blob/master/LICENSE 82 | 'github.com/gogo/googleapis/.*' # Apache-2.0 https://github.com/gogo/googleapis/blob/master/LICENSE 83 | ) 84 | 85 | # These lines in the output should be ignored (plain text, no regex). 86 | IGNORE_LINES=( 87 | '"module name","licenses"' # header of license output for Node.js 88 | ) 89 | 90 | echo_green() { 91 | printf "\e[1;92m%s\e[0m\n" "$@" 92 | } 93 | 94 | echo_red() { 95 | printf "\e[0;91m%s\e[0m\n" "$@" 96 | } 97 | 98 | # capture STDIN 99 | input=$(cat -) 100 | 101 | # remove ignored lines 102 | for ignored in "${IGNORE_LINES[@]}"; do 103 | input=$(echo "$input" | grep -vF "$ignored") 104 | done 105 | 106 | # remove pre-approved modules 107 | for approved in "${APPROVED_MODULES[@]}"; do 108 | input=$(echo "$input" | grep -vE "\"${approved}\"") 109 | input=$(echo "$input" | grep -vE "\"Custom: ${approved}\"") 110 | done 111 | 112 | # remove allowed licenses 113 | for allowed in "${ALLOWED_LICENSES[@]}"; do 114 | input=$(echo "$input" | grep -vF "\"${allowed}\"") 115 | done 116 | 117 | # anything left in the input at this point is a module with an invalid license 118 | 119 | # print outcome 120 | if [ -z "$input" ]; then 121 | echo_green "Licenses are okay." 122 | else 123 | echo_red "Unknown licenses found!" 124 | echo "$input" 125 | exit 1 126 | fi 127 | -------------------------------------------------------------------------------- /.bin/license-template-go.tpl: -------------------------------------------------------------------------------- 1 | {{ range . }} 2 | "{{.Name}}","{{.LicenseName}}" 3 | {{- end }} 4 | -------------------------------------------------------------------------------- /.bin/licenses: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # Get the directory where this script is located 5 | bin_dir="$(cd "$(dirname "$0")" && pwd)" 6 | 7 | { echo "Checking licenses ..."; } 2>/dev/null 8 | "${bin_dir}/list-licenses" | "${bin_dir}/license-engine.sh" 9 | -------------------------------------------------------------------------------- /.bin/list-licenses: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | bin_dir="$(cd "$(dirname "$0")" && pwd)" 5 | 6 | # list Node licenses 7 | if [ -f package.json ]; then 8 | if jq -e '.dependencies and (.dependencies | keys | length > 0)' package.json >/dev/null; then 9 | npx --yes license-checker --production --csv --excludePrivatePackages --customPath "${bin_dir}"/license-template-node.json | grep -v '^$' 10 | echo 11 | else 12 | echo "No dependencies found in package.json" >&2 13 | echo 14 | fi 15 | fi 16 | 17 | # list Go licenses 18 | if [ -f go.mod ]; then 19 | # List all direct Go module dependencies, transform their paths to root module paths 20 | # (e.g., github.com/ory/x instead of github.com/ory/x/foo/bar), and generate a license report 21 | # for each unique root module. This ensures that the license report is generated for the root 22 | # module of a repository, where licenses are typically defined. 23 | go_modules=$( 24 | go list -f "{{if not .Indirect}}{{.Path}}{{end}}" -m ... | 25 | sort -u | 26 | awk -F/ '{ if ($1 == "github.com" && NF >= 3) { print $1"/"$2"/"$3 } else { print } }' | 27 | sort -u 28 | ) 29 | if [ -z "$go_modules" ]; then 30 | echo "No Go modules found" >&2 31 | else 32 | # Workaround until https://github.com/google/go-licenses/issues/307 is fixed 33 | # .bin/go-licenses report "$module_name" --template .bin/license-template-go.tpl 2>/dev/null 34 | # 35 | echo "$go_modules" | xargs -I {} sh -c '.bin/go-licenses report --template .bin/license-template-go.tpl {}' | grep -v '^$' 36 | echo 37 | fi 38 | fi 39 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/FUNDING.yml 3 | 4 | # These are supported funding model platforms 5 | 6 | # github: 7 | patreon: _ory 8 | open_collective: ory 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG-REPORT.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/ISSUE_TEMPLATE/BUG-REPORT.yml 3 | 4 | description: "Create a bug report" 5 | labels: 6 | - bug 7 | name: "Bug Report" 8 | body: 9 | - attributes: 10 | value: "Thank you for taking the time to fill out this bug report!\n" 11 | type: markdown 12 | - attributes: 13 | label: "Preflight checklist" 14 | options: 15 | - label: 16 | "I could not find a solution in the existing issues, docs, nor 17 | discussions." 18 | required: true 19 | - label: 20 | "I agree to follow this project's [Code of 21 | Conduct](https://github.com/ory/oathkeeper-client-go/blob/master/CODE_OF_CONDUCT.md)." 22 | required: true 23 | - label: 24 | "I have read and am following this repository's [Contribution 25 | Guidelines](https://github.com/ory/oathkeeper-client-go/blob/master/CONTRIBUTING.md)." 26 | required: true 27 | - label: 28 | "I have joined the [Ory Community Slack](https://slack.ory.sh)." 29 | - label: 30 | "I am signed up to the [Ory Security Patch 31 | Newsletter](https://www.ory.sh/l/sign-up-newsletter)." 32 | id: checklist 33 | type: checkboxes 34 | - attributes: 35 | description: 36 | "Enter the slug or API URL of the affected Ory Network project. Leave 37 | empty when you are self-hosting." 38 | label: "Ory Network Project" 39 | placeholder: "https://.projects.oryapis.com" 40 | id: ory-network-project 41 | type: input 42 | - attributes: 43 | description: "A clear and concise description of what the bug is." 44 | label: "Describe the bug" 45 | placeholder: "Tell us what you see!" 46 | id: describe-bug 47 | type: textarea 48 | validations: 49 | required: true 50 | - attributes: 51 | description: | 52 | Clear, formatted, and easy to follow steps to reproduce the behavior: 53 | placeholder: | 54 | Steps to reproduce the behavior: 55 | 56 | 1. Run `docker run ....` 57 | 2. Make API Request to with `curl ...` 58 | 3. Request fails with response: `{"some": "error"}` 59 | label: "Reproducing the bug" 60 | id: reproduce-bug 61 | type: textarea 62 | validations: 63 | required: true 64 | - attributes: 65 | description: 66 | "Please copy and paste any relevant log output. This will be 67 | automatically formatted into code, so no need for backticks. Please 68 | redact any sensitive information" 69 | label: "Relevant log output" 70 | render: shell 71 | placeholder: | 72 | log=error .... 73 | id: logs 74 | type: textarea 75 | - attributes: 76 | description: 77 | "Please copy and paste any relevant configuration. This will be 78 | automatically formatted into code, so no need for backticks. Please 79 | redact any sensitive information!" 80 | label: "Relevant configuration" 81 | render: yml 82 | placeholder: | 83 | server: 84 | admin: 85 | port: 1234 86 | id: config 87 | type: textarea 88 | - attributes: 89 | description: "What version of our software are you running?" 90 | label: Version 91 | id: version 92 | type: input 93 | validations: 94 | required: true 95 | - attributes: 96 | label: "On which operating system are you observing this issue?" 97 | options: 98 | - Ory Network 99 | - macOS 100 | - Linux 101 | - Windows 102 | - FreeBSD 103 | - Other 104 | id: operating-system 105 | type: dropdown 106 | - attributes: 107 | label: "In which environment are you deploying?" 108 | options: 109 | - Ory Network 110 | - Docker 111 | - "Docker Compose" 112 | - "Kubernetes with Helm" 113 | - Kubernetes 114 | - Binary 115 | - Other 116 | id: deployment 117 | type: dropdown 118 | - attributes: 119 | description: "Add any other context about the problem here." 120 | label: Additional Context 121 | id: additional 122 | type: textarea 123 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/DESIGN-DOC.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/ISSUE_TEMPLATE/DESIGN-DOC.yml 3 | 4 | description: 5 | "A design document is needed for non-trivial changes to the code base." 6 | labels: 7 | - rfc 8 | name: "Design Document" 9 | body: 10 | - attributes: 11 | value: | 12 | Thank you for writing this design document. 13 | 14 | One of the key elements of Ory's software engineering culture is the use of defining software designs through design docs. These are relatively informal documents that the primary author or authors of a software system or application create before they embark on the coding project. The design doc documents the high level implementation strategy and key design decisions with emphasis on the trade-offs that were considered during those decisions. 15 | 16 | Ory is leaning heavily on [Google's design docs process](https://www.industrialempathy.com/posts/design-docs-at-google/) 17 | and [Golang Proposals](https://github.com/golang/proposal). 18 | 19 | Writing a design doc before contributing your change ensures that your ideas are checked with 20 | the community and maintainers. It will save you a lot of time developing things that might need to be changed 21 | after code reviews, and your pull requests will be merged faster. 22 | type: markdown 23 | - attributes: 24 | label: "Preflight checklist" 25 | options: 26 | - label: 27 | "I could not find a solution in the existing issues, docs, nor 28 | discussions." 29 | required: true 30 | - label: 31 | "I agree to follow this project's [Code of 32 | Conduct](https://github.com/ory/oathkeeper-client-go/blob/master/CODE_OF_CONDUCT.md)." 33 | required: true 34 | - label: 35 | "I have read and am following this repository's [Contribution 36 | Guidelines](https://github.com/ory/oathkeeper-client-go/blob/master/CONTRIBUTING.md)." 37 | required: true 38 | - label: 39 | "I have joined the [Ory Community Slack](https://slack.ory.sh)." 40 | - label: 41 | "I am signed up to the [Ory Security Patch 42 | Newsletter](https://www.ory.sh/l/sign-up-newsletter)." 43 | id: checklist 44 | type: checkboxes 45 | - attributes: 46 | description: 47 | "Enter the slug or API URL of the affected Ory Network project. Leave 48 | empty when you are self-hosting." 49 | label: "Ory Network Project" 50 | placeholder: "https://.projects.oryapis.com" 51 | id: ory-network-project 52 | type: input 53 | - attributes: 54 | description: | 55 | This section gives the reader a very rough overview of the landscape in which the new system is being built and what is actually being built. This isn’t a requirements doc. Keep it succinct! The goal is that readers are brought up to speed but some previous knowledge can be assumed and detailed info can be linked to. This section should be entirely focused on objective background facts. 56 | label: "Context and scope" 57 | id: scope 58 | type: textarea 59 | validations: 60 | required: true 61 | 62 | - attributes: 63 | description: | 64 | A short list of bullet points of what the goals of the system are, and, sometimes more importantly, what non-goals are. Note, that non-goals aren’t negated goals like “The system shouldn’t crash”, but rather things that could reasonably be goals, but are explicitly chosen not to be goals. A good example would be “ACID compliance”; when designing a database, you’d certainly want to know whether that is a goal or non-goal. And if it is a non-goal you might still select a solution that provides it, if it doesn’t introduce trade-offs that prevent achieving the goals. 65 | label: "Goals and non-goals" 66 | id: goals 67 | type: textarea 68 | validations: 69 | required: true 70 | 71 | - attributes: 72 | description: | 73 | This section should start with an overview and then go into details. 74 | The design doc is the place to write down the trade-offs you made in designing your software. Focus on those trade-offs to produce a useful document with long-term value. That is, given the context (facts), goals and non-goals (requirements), the design doc is the place to suggest solutions and show why a particular solution best satisfies those goals. 75 | 76 | The point of writing a document over a more formal medium is to provide the flexibility to express the problem at hand in an appropriate manner. Because of this, there is no explicit guidance on how to actually describe the design. 77 | label: "The design" 78 | id: design 79 | type: textarea 80 | validations: 81 | required: true 82 | 83 | - attributes: 84 | description: | 85 | If the system under design exposes an API, then sketching out that API is usually a good idea. In most cases, however, one should withstand the temptation to copy-paste formal interface or data definitions into the doc as these are often verbose, contain unnecessary detail and quickly get out of date. Instead, focus on the parts that are relevant to the design and its trade-offs. 86 | label: "APIs" 87 | id: apis 88 | type: textarea 89 | 90 | - attributes: 91 | description: | 92 | Systems that store data should likely discuss how and in what rough form this happens. Similar to the advice on APIs, and for the same reasons, copy-pasting complete schema definitions should be avoided. Instead, focus on the parts that are relevant to the design and its trade-offs. 93 | label: "Data storage" 94 | id: persistence 95 | type: textarea 96 | 97 | - attributes: 98 | description: | 99 | Design docs should rarely contain code, or pseudo-code except in situations where novel algorithms are described. As appropriate, link to prototypes that show the feasibility of the design. 100 | label: "Code and pseudo-code" 101 | id: pseudocode 102 | type: textarea 103 | 104 | - attributes: 105 | description: | 106 | One of the primary factors that would influence the shape of a software design and hence the design doc, is the degree of constraint of the solution space. 107 | 108 | On one end of the extreme is the “greenfield software project”, where all we know are the goals, and the solution can be whatever makes the most sense. Such a document may be wide-ranging, but it also needs to quickly define a set of rules that allow zooming in on a manageable set of solutions. 109 | 110 | On the other end are systems where the possible solutions are very well defined, but it isn't at all obvious how they could even be combined to achieve the goals. This may be a legacy system that is difficult to change and wasn't designed to do what you want it to do or a library design that needs to operate within the constraints of the host programming language. 111 | 112 | In this situation, you may be able to enumerate all the things you can do relatively easily, but you need to creatively put those things together to achieve the goals. There may be multiple solutions, and none of them are great, and hence such a document should focus on selecting the best way given all identified trade-offs. 113 | label: "Degree of constraint" 114 | id: constrait 115 | type: textarea 116 | 117 | - attributes: 118 | description: | 119 | This section lists alternative designs that would have reasonably achieved similar outcomes. The focus should be on the trade-offs that each respective design makes and how those trade-offs led to the decision to select the design that is the primary topic of the document. 120 | 121 | While it is fine to be succinct about a solution that ended up not being selected, this section is one of the most important ones as it shows very explicitly why the selected solution is the best given the project goals and how other solutions, that the reader may be wondering about, introduce trade-offs that are less desirable given the goals. 122 | 123 | label: Alternatives considered 124 | id: alternatives 125 | type: textarea 126 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml 3 | 4 | description: 5 | "Suggest an idea for this project without a plan for implementation" 6 | labels: 7 | - feat 8 | name: "Feature Request" 9 | body: 10 | - attributes: 11 | value: | 12 | Thank you for suggesting an idea for this project! 13 | 14 | If you already have a plan to implement a feature or a change, please create a [design document](https://github.com/aeneasr/gh-template-test/issues/new?assignees=&labels=rfc&template=DESIGN-DOC.yml) instead if the change is non-trivial! 15 | type: markdown 16 | - attributes: 17 | label: "Preflight checklist" 18 | options: 19 | - label: 20 | "I could not find a solution in the existing issues, docs, nor 21 | discussions." 22 | required: true 23 | - label: 24 | "I agree to follow this project's [Code of 25 | Conduct](https://github.com/ory/oathkeeper-client-go/blob/master/CODE_OF_CONDUCT.md)." 26 | required: true 27 | - label: 28 | "I have read and am following this repository's [Contribution 29 | Guidelines](https://github.com/ory/oathkeeper-client-go/blob/master/CONTRIBUTING.md)." 30 | required: true 31 | - label: 32 | "I have joined the [Ory Community Slack](https://slack.ory.sh)." 33 | - label: 34 | "I am signed up to the [Ory Security Patch 35 | Newsletter](https://www.ory.sh/l/sign-up-newsletter)." 36 | id: checklist 37 | type: checkboxes 38 | - attributes: 39 | description: 40 | "Enter the slug or API URL of the affected Ory Network project. Leave 41 | empty when you are self-hosting." 42 | label: "Ory Network Project" 43 | placeholder: "https://.projects.oryapis.com" 44 | id: ory-network-project 45 | type: input 46 | - attributes: 47 | description: 48 | "Is your feature request related to a problem? Please describe." 49 | label: "Describe your problem" 50 | placeholder: 51 | "A clear and concise description of what the problem is. Ex. I'm always 52 | frustrated when [...]" 53 | id: problem 54 | type: textarea 55 | validations: 56 | required: true 57 | - attributes: 58 | description: | 59 | Describe the solution you'd like 60 | placeholder: | 61 | A clear and concise description of what you want to happen. 62 | label: "Describe your ideal solution" 63 | id: solution 64 | type: textarea 65 | validations: 66 | required: true 67 | - attributes: 68 | description: "Describe alternatives you've considered" 69 | label: "Workarounds or alternatives" 70 | id: alternatives 71 | type: textarea 72 | validations: 73 | required: true 74 | - attributes: 75 | description: "What version of our software are you running?" 76 | label: Version 77 | id: version 78 | type: input 79 | validations: 80 | required: true 81 | - attributes: 82 | description: 83 | "Add any other context or screenshots about the feature request here." 84 | label: Additional Context 85 | id: additional 86 | type: textarea 87 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/ISSUE_TEMPLATE/config.yml 3 | 4 | blank_issues_enabled: false 5 | contact_links: 6 | - name: Ory Ory Oathkeeper Go Client Forum 7 | url: https://github.com/orgs/ory/discussions 8 | about: 9 | Please ask and answer questions here, show your implementations and 10 | discuss ideas. 11 | - name: Ory Chat 12 | url: https://www.ory.sh/chat 13 | about: 14 | Hang out with other Ory community members to ask and answer questions. 15 | -------------------------------------------------------------------------------- /.github/auto_assign.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/auto_assign.yml 3 | 4 | # Set to true to add reviewers to pull requests 5 | addReviewers: true 6 | 7 | # Set to true to add assignees to pull requests 8 | addAssignees: true 9 | 10 | # A list of reviewers to be added to pull requests (GitHub user name) 11 | assignees: 12 | - ory/maintainers 13 | 14 | # A number of reviewers added to the pull request 15 | # Set 0 to add all the reviewers (default: 0) 16 | numberOfReviewers: 0 17 | -------------------------------------------------------------------------------- /.github/config.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/config.yml 3 | 4 | todo: 5 | keyword: "@todo" 6 | label: todo 7 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 12 | 13 | ## Related Issue or Design Document 14 | 15 | 29 | 30 | ## Checklist 31 | 32 | 36 | 37 | - [ ] I have read the [contributing guidelines](../blob/master/CONTRIBUTING.md) and signed the CLA. 38 | - [ ] I have referenced an issue containing the design document if my change introduces a new feature. 39 | - [ ] I have read the [security policy](../security/policy). 40 | - [ ] I confirm that this pull request does not address a security vulnerability. 41 | If this pull request addresses a security vulnerability, 42 | I confirm that I got approval (please contact [security@ory.sh](mailto:security@ory.sh)) from the maintainers to push the changes. 43 | - [ ] I have added tests that prove my fix is effective or that my feature works. 44 | - [ ] I have added the necessary documentation within the code base (if appropriate). 45 | 46 | ## Further comments 47 | 48 | 52 | -------------------------------------------------------------------------------- /.github/workflows/closed_references.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/workflows/closed_references.yml 3 | 4 | name: Closed Reference Notifier 5 | 6 | on: 7 | schedule: 8 | - cron: "0 0 * * *" 9 | workflow_dispatch: 10 | inputs: 11 | issueLimit: 12 | description: Max. number of issues to create 13 | required: true 14 | default: "5" 15 | 16 | jobs: 17 | find_closed_references: 18 | if: github.repository_owner == 'ory' 19 | runs-on: ubuntu-latest 20 | name: Find closed references 21 | steps: 22 | - uses: actions/checkout@v2 23 | - uses: actions/setup-node@v2-beta 24 | with: 25 | node-version: "14" 26 | - uses: ory/closed-reference-notifier@v1 27 | with: 28 | token: ${{ secrets.GITHUB_TOKEN }} 29 | issueLabels: upstream,good first issue,help wanted 30 | issueLimit: ${{ github.event.inputs.issueLimit || '5' }} 31 | -------------------------------------------------------------------------------- /.github/workflows/conventional_commits.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/workflows/conventional_commits.yml 3 | 4 | name: Conventional commits 5 | 6 | # This GitHub CI Action enforces that pull request titles follow conventional commits. 7 | # More info at https://www.conventionalcommits.org. 8 | # 9 | # The Ory-wide defaults for commit titles and scopes are below. 10 | # Your repository can add/replace elements via a configuration file at the path below. 11 | # More info at https://github.com/ory/ci/blob/master/conventional_commit_config/README.md 12 | 13 | on: 14 | pull_request_target: 15 | types: 16 | - edited 17 | - opened 18 | - ready_for_review 19 | - reopened 20 | # pull_request: # for debugging, uses config in local branch but supports only Pull Requests from this repo 21 | 22 | jobs: 23 | main: 24 | name: Validate PR title 25 | runs-on: ubuntu-latest 26 | steps: 27 | - uses: actions/checkout@v3 28 | - id: config 29 | uses: ory/ci/conventional_commit_config@master 30 | with: 31 | config_path: .github/conventional_commits.json 32 | default_types: | 33 | feat 34 | fix 35 | revert 36 | docs 37 | style 38 | refactor 39 | test 40 | build 41 | autogen 42 | security 43 | ci 44 | chore 45 | default_scopes: | 46 | deps 47 | docs 48 | default_require_scope: false 49 | - uses: amannn/action-semantic-pull-request@v4 50 | env: 51 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 52 | with: 53 | types: ${{ steps.config.outputs.types }} 54 | scopes: ${{ steps.config.outputs.scopes }} 55 | requireScope: ${{ steps.config.outputs.requireScope }} 56 | subjectPattern: ^(?![A-Z]).+$ 57 | subjectPatternError: | 58 | The subject should start with a lowercase letter, yours is uppercase: 59 | "{subject}" 60 | -------------------------------------------------------------------------------- /.github/workflows/labels.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/workflows/labels.yml 3 | 4 | name: Synchronize Issue Labels 5 | 6 | on: 7 | workflow_dispatch: 8 | push: 9 | branches: 10 | - master 11 | 12 | jobs: 13 | milestone: 14 | if: github.repository_owner == 'ory' 15 | name: Synchronize Issue Labels 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v2 20 | - name: Synchronize Issue Labels 21 | uses: ory/label-sync-action@v0 22 | with: 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | dry: false 25 | forced: true 26 | -------------------------------------------------------------------------------- /.github/workflows/licenses.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/workflows/licenses.yml 3 | 4 | name: Licenses 5 | 6 | on: 7 | pull_request: 8 | push: 9 | branches: 10 | - main 11 | - v3 12 | - master 13 | 14 | jobs: 15 | licenses: 16 | name: License compliance 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Install script 20 | uses: ory/ci/licenses/setup@master 21 | with: 22 | token: ${{ secrets.ORY_BOT_PAT || secrets.GITHUB_TOKEN }} 23 | - name: Check licenses 24 | uses: ory/ci/licenses/check@master 25 | - name: Write, commit, push licenses 26 | uses: ory/ci/licenses/write@master 27 | if: 28 | ${{ github.ref == 'refs/heads/main' || github.ref == 29 | 'refs/heads/master' || github.ref == 'refs/heads/v3' }} 30 | with: 31 | author-email: 32 | ${{ secrets.ORY_BOT_PAT && 33 | '60093411+ory-bot@users.noreply.github.com' || 34 | format('{0}@users.noreply.github.com', github.actor) }} 35 | author-name: ${{ secrets.ORY_BOT_PAT && 'ory-bot' || github.actor }} 36 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | # AUTO-GENERATED, DO NOT EDIT! 2 | # Please edit the original at https://github.com/ory/meta/blob/master/templates/repository/common/.github/workflows/stale.yml 3 | 4 | name: "Close Stale Issues" 5 | on: 6 | workflow_dispatch: 7 | schedule: 8 | - cron: "0 0 * * *" 9 | 10 | jobs: 11 | stale: 12 | if: github.repository_owner == 'ory' 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/stale@v4 16 | with: 17 | repo-token: ${{ secrets.GITHUB_TOKEN }} 18 | stale-issue-message: | 19 | Hello contributors! 20 | 21 | I am marking this issue as stale as it has not received any engagement from the community or maintainers for a year. That does not imply that the issue has no merit! If you feel strongly about this issue 22 | 23 | - open a PR referencing and resolving the issue; 24 | - leave a comment on it and discuss ideas on how you could contribute towards resolving it; 25 | - leave a comment and describe in detail why this issue is critical for your use case; 26 | - open a new issue with updated details and a plan for resolving the issue. 27 | 28 | Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic. 29 | 30 | Unfortunately, [burnout](https://www.jeffgeerling.com/blog/2016/why-i-close-prs-oss-project-maintainer-notes) has become a [topic](https://opensource.guide/best-practices/#its-okay-to-hit-pause) of [concern](https://docs.brew.sh/Maintainers-Avoiding-Burnout) amongst open-source projects. 31 | 32 | It can lead to severe personal and health issues as well as [opening](https://haacked.com/archive/2019/05/28/maintainer-burnout/) catastrophic [attack vectors](https://www.gradiant.org/en/blog/open-source-maintainer-burnout-as-an-attack-surface/). 33 | 34 | The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone. 35 | 36 | If this issue was marked as stale erroneously you can exempt it by adding the `backlog` label, assigning someone, or setting a milestone for it. 37 | 38 | Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you! 39 | 40 | Thank you 🙏✌️ 41 | stale-issue-label: "stale" 42 | exempt-issue-labels: "bug,blocking,docs,backlog" 43 | days-before-stale: 365 44 | days-before-close: 30 45 | exempt-milestones: true 46 | exempt-assignees: true 47 | only-pr-labels: "stale" 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | -------------------------------------------------------------------------------- /.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | .gitignore 2 | .openapi-generator-ignore 3 | .travis.yml 4 | README.md 5 | api/openapi.yaml 6 | api_api.go 7 | api_health.go 8 | api_version.go 9 | client.go 10 | configuration.go 11 | docs/ApiAPI.md 12 | docs/GenericError.md 13 | docs/HealthAPI.md 14 | docs/HealthNotReadyStatus.md 15 | docs/HealthStatus.md 16 | docs/JsonWebKey.md 17 | docs/JsonWebKeySet.md 18 | docs/Rule.md 19 | docs/RuleHandler.md 20 | docs/RuleMatch.md 21 | docs/Upstream.md 22 | docs/Version.md 23 | docs/VersionAPI.md 24 | git_push.sh 25 | go.mod 26 | go.sum 27 | model_generic_error.go 28 | model_health_not_ready_status.go 29 | model_health_status.go 30 | model_json_web_key.go 31 | model_json_web_key_set.go 32 | model_rule.go 33 | model_rule_handler.go 34 | model_rule_match.go 35 | model_upstream.go 36 | model_version.go 37 | response.go 38 | test/api_api_test.go 39 | test/api_health_test.go 40 | test/api_version_test.go 41 | utils.go 42 | -------------------------------------------------------------------------------- /.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 7.6.0 2 | -------------------------------------------------------------------------------- /.reference-ignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | docs 3 | CHANGELOG.md 4 | -------------------------------------------------------------------------------- /.reports/dep-licenses.csv: -------------------------------------------------------------------------------- 1 | "github.com/ory/oathkeeper-client-go","Apache-2.0" 2 | "github.com/stretchr/testify","MIT" 3 | 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | install: 4 | - go get -d -v . 5 | 6 | script: 7 | - go build -v ./ 8 | 9 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # Contributor Covenant Code of Conduct 5 | 6 | ## Our Pledge 7 | 8 | We as members, contributors, and leaders pledge to make participation in our 9 | community a harassment-free experience for everyone, regardless of age, body 10 | size, visible or invisible disability, ethnicity, sex characteristics, gender 11 | identity and expression, level of experience, education, socio-economic status, 12 | nationality, personal appearance, race, caste, color, religion, or sexual 13 | identity and orientation. 14 | 15 | We pledge to act and interact in ways that contribute to an open, welcoming, 16 | diverse, inclusive, and healthy community. 17 | 18 | ## Our Standards 19 | 20 | Examples of behavior that contributes to a positive environment for our 21 | community include: 22 | 23 | - Demonstrating empathy and kindness toward other people 24 | - Being respectful of differing opinions, viewpoints, and experiences 25 | - Giving and gracefully accepting constructive feedback 26 | - Accepting responsibility and apologizing to those affected by our mistakes, 27 | and learning from the experience 28 | - Focusing on what is best not just for us as individuals, but for the overall 29 | community 30 | 31 | Examples of unacceptable behavior include: 32 | 33 | - The use of sexualized language or imagery, and sexual attention or advances of 34 | any kind 35 | - Trolling, insulting or derogatory comments, and personal or political attacks 36 | - Public or private harassment 37 | - Publishing others' private information, such as a physical or email address, 38 | without their explicit permission 39 | - Other conduct which could reasonably be considered inappropriate in a 40 | professional setting 41 | 42 | ## Open Source Community Support 43 | 44 | Ory Open source software is collaborative and based on contributions by 45 | developers in the Ory community. There is no obligation from Ory to help with 46 | individual problems. If Ory open source software is used in production in a 47 | for-profit company or enterprise environment, we mandate a paid support contract 48 | where Ory is obligated under their service level agreements (SLAs) to offer a 49 | defined level of availability and responsibility. For more information about 50 | paid support please contact us at sales@ory.sh. 51 | 52 | ## Enforcement Responsibilities 53 | 54 | Community leaders are responsible for clarifying and enforcing our standards of 55 | acceptable behavior and will take appropriate and fair corrective action in 56 | response to any behavior that they deem inappropriate, threatening, offensive, 57 | or harmful. 58 | 59 | Community leaders have the right and responsibility to remove, edit, or reject 60 | comments, commits, code, wiki edits, issues, and other contributions that are 61 | not aligned to this Code of Conduct, and will communicate reasons for moderation 62 | decisions when appropriate. 63 | 64 | ## Scope 65 | 66 | This Code of Conduct applies within all community spaces, and also applies when 67 | an individual is officially representing the community in public spaces. 68 | Examples of representing our community include using an official e-mail address, 69 | posting via an official social media account, or acting as an appointed 70 | representative at an online or offline event. 71 | 72 | ## Enforcement 73 | 74 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 75 | reported to the community leaders responsible for enforcement at 76 | [office@ory.sh](mailto:office@ory.sh). All complaints will be reviewed and 77 | investigated promptly and fairly. 78 | 79 | All community leaders are obligated to respect the privacy and security of the 80 | reporter of any incident. 81 | 82 | ## Enforcement Guidelines 83 | 84 | Community leaders will follow these Community Impact Guidelines in determining 85 | the consequences for any action they deem in violation of this Code of Conduct: 86 | 87 | ### 1. Correction 88 | 89 | **Community Impact**: Use of inappropriate language or other behavior deemed 90 | unprofessional or unwelcome in the community. 91 | 92 | **Consequence**: A private, written warning from community leaders, providing 93 | clarity around the nature of the violation and an explanation of why the 94 | behavior was inappropriate. A public apology may be requested. 95 | 96 | ### 2. Warning 97 | 98 | **Community Impact**: A violation through a single incident or series of 99 | actions. 100 | 101 | **Consequence**: A warning with consequences for continued behavior. No 102 | interaction with the people involved, including unsolicited interaction with 103 | those enforcing the Code of Conduct, for a specified period of time. This 104 | includes avoiding interactions in community spaces as well as external channels 105 | like social media. Violating these terms may lead to a temporary or permanent 106 | ban. 107 | 108 | ### 3. Temporary Ban 109 | 110 | **Community Impact**: A serious violation of community standards, including 111 | sustained inappropriate behavior. 112 | 113 | **Consequence**: A temporary ban from any sort of interaction or public 114 | communication with the community for a specified period of time. No public or 115 | private interaction with the people involved, including unsolicited interaction 116 | with those enforcing the Code of Conduct, is allowed during this period. 117 | Violating these terms may lead to a permanent ban. 118 | 119 | ### 4. Permanent Ban 120 | 121 | **Community Impact**: Demonstrating a pattern of violation of community 122 | standards, including sustained inappropriate behavior, harassment of an 123 | individual, or aggression toward or disparagement of classes of individuals. 124 | 125 | **Consequence**: A permanent ban from any sort of public interaction within the 126 | community. 127 | 128 | ## Attribution 129 | 130 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 131 | version 2.1, available at 132 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 133 | 134 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 135 | enforcement ladder][mozilla coc]. 136 | 137 | For answers to common questions about this code of conduct, see the FAQ at 138 | [https://www.contributor-covenant.org/faq][faq]. Translations are available at 139 | [https://www.contributor-covenant.org/translations][translations]. 140 | 141 | [homepage]: https://www.contributor-covenant.org 142 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 143 | [mozilla coc]: https://github.com/mozilla/diversity 144 | [faq]: https://www.contributor-covenant.org/faq 145 | [translations]: https://www.contributor-covenant.org/translations 146 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # Contribute to Ory Ory Oathkeeper Go Client 5 | 6 | 7 | 8 | 9 | - [Introduction](#introduction) 10 | - [FAQ](#faq) 11 | - [How can I contribute?](#how-can-i-contribute) 12 | - [Communication](#communication) 13 | - [Contribute examples or community projects](#contribute-examples-or-community-projects) 14 | - [Contribute code](#contribute-code) 15 | - [Contribute documentation](#contribute-documentation) 16 | - [Disclosing vulnerabilities](#disclosing-vulnerabilities) 17 | - [Code style](#code-style) 18 | - [Working with forks](#working-with-forks) 19 | - [Conduct](#conduct) 20 | 21 | 22 | 23 | ## Introduction 24 | 25 | _Please note_: We take Ory Ory Oathkeeper Go Client's security and our users' trust very 26 | seriously. If you believe you have found a security issue in Ory Ory Oathkeeper Go Client, 27 | please disclose it by contacting us at security@ory.sh. 28 | 29 | There are many ways in which you can contribute. The goal of this document is to 30 | provide a high-level overview of how you can get involved in Ory. 31 | 32 | As a potential contributor, your changes and ideas are welcome at any hour of 33 | the day or night, on weekdays, weekends, and holidays. Please do not ever 34 | hesitate to ask a question or send a pull request. 35 | 36 | If you are unsure, just ask or submit the issue or pull request anyways. You 37 | won't be yelled at for giving it your best effort. The worst that can happen is 38 | that you'll be politely asked to change something. We appreciate any sort of 39 | contributions and don't want a wall of rules to get in the way of that. 40 | 41 | That said, if you want to ensure that a pull request is likely to be merged, 42 | talk to us! You can find out our thoughts and ensure that your contribution 43 | won't clash with Ory 44 | Ory Oathkeeper Go Client's direction. A great way to 45 | do this is via 46 | [Ory Ory Oathkeeper Go Client Discussions](https://github.com/orgs/ory/discussions) 47 | or the [Ory Chat](https://www.ory.sh/chat). 48 | 49 | ## FAQ 50 | 51 | - I am new to the community. Where can I find the 52 | [Ory Community Code of Conduct?](https://github.com/ory/oathkeeper-client-go/blob/master/CODE_OF_CONDUCT.md) 53 | 54 | - I have a question. Where can I get 55 | [answers to questions regarding Ory Ory Oathkeeper Go Client?](#communication) 56 | 57 | - I would like to contribute but I am not sure how. Are there 58 | [easy ways to contribute?](#how-can-i-contribute) 59 | [Or good first issues?](https://github.com/search?l=&o=desc&q=label%3A%22help+wanted%22+label%3A%22good+first+issue%22+is%3Aopen+user%3Aory+user%3Aory-corp&s=updated&type=Issues) 60 | 61 | - I want to talk to other Ory Ory Oathkeeper Go Client users. 62 | [How can I become a part of the community?](#communication) 63 | 64 | - I would like to know what I am agreeing to when I contribute to Ory 65 | Ory Oathkeeper Go Client. 66 | Does Ory have 67 | [a Contributors License Agreement?](https://cla-assistant.io/ory/oathkeeper-client-go) 68 | 69 | - I would like updates about new versions of Ory Ory Oathkeeper Go Client. 70 | [How are new releases announced?](https://www.ory.sh/l/sign-up-newsletter) 71 | 72 | ## How can I contribute? 73 | 74 | If you want to start to contribute code right away, take a look at the 75 | [list of good first issues](https://github.com/ory/oathkeeper-client-go/labels/good%20first%20issue). 76 | 77 | There are many other ways you can contribute. Here are a few things you can do 78 | to help out: 79 | 80 | - **Give us a star.** It may not seem like much, but it really makes a 81 | difference. This is something that everyone can do to help out Ory Ory Oathkeeper Go Client. 82 | Github stars help the project gain visibility and stand out. 83 | 84 | - **Join the community.** Sometimes helping people can be as easy as listening 85 | to their problems and offering a different perspective. Join our Slack, have a 86 | look at discussions in the forum and take part in community events. More info 87 | on this in [Communication](#communication). 88 | 89 | - **Answer discussions.** At all times, there are several unanswered discussions 90 | on GitHub. You can see an 91 | [overview here](https://github.com/discussions?discussions_q=is%3Aunanswered+org%3Aory+sort%3Aupdated-desc). 92 | If you think you know an answer or can provide some information that might 93 | help, please share it! Bonus: You get GitHub achievements for answered 94 | discussions. 95 | 96 | - **Help with open issues.** We have a lot of open issues for Ory Ory Oathkeeper Go Client and 97 | some of them may lack necessary information, some are duplicates of older 98 | issues. You can help out by guiding people through the process of filling out 99 | the issue template, asking for clarifying information or pointing them to 100 | existing issues that match their description of the problem. 101 | 102 | - **Review documentation changes.** Most documentation just needs a review for 103 | proper spelling and grammar. If you think a document can be improved in any 104 | way, feel free to hit the `edit` button at the top of the page. More info on 105 | contributing to the documentation [here](#contribute-documentation). 106 | 107 | - **Help with tests.** Pull requests may lack proper tests or test plans. These 108 | are needed for the change to be implemented safely. 109 | 110 | ## Communication 111 | 112 | We use [Slack](https://www.ory.sh/chat). You are welcome to drop in and ask 113 | questions, discuss bugs and feature requests, talk to other users of Ory, etc. 114 | 115 | Check out [Ory Ory Oathkeeper Go Client Discussions](https://github.com/orgs/ory/discussions). This is a great place for 116 | in-depth discussions and lots of code examples, logs and similar data. 117 | 118 | You can also join our community calls if you want to speak to the Ory team 119 | directly or ask some questions. You can find more info and participate in 120 | [Slack](https://www.ory.sh/chat) in the #community-call channel. 121 | 122 | If you want to receive regular notifications about updates to Ory Ory Oathkeeper Go Client, 123 | consider joining the mailing list. We will _only_ send you vital information on 124 | the projects that you are interested in. 125 | 126 | Also, [follow us on Twitter](https://twitter.com/orycorp). 127 | 128 | ## Contribute examples or community projects 129 | 130 | One of the most impactful ways to contribute is by adding code examples or other 131 | Ory-related code. You can find an overview of community code in the 132 | [awesome-ory](https://github.com/ory/awesome-ory) repository. 133 | 134 | _If you would like to contribute a new example, we would love to hear from you!_ 135 | 136 | Please [open a pull request at awesome-ory](https://github.com/ory/awesome-ory/) 137 | to add your example or Ory-related project to the awesome-ory README. 138 | 139 | ## Contribute code 140 | 141 | Unless you are fixing a known bug, we **strongly** recommend discussing it with 142 | the core team via a GitHub issue or [in our chat](https://www.ory.sh/chat) 143 | before getting started to ensure your work is consistent with Ory Ory Oathkeeper Go Client's 144 | roadmap and architecture. 145 | 146 | All contributions are made via pull requests. To make a pull request, you will 147 | need a GitHub account; if you are unclear on this process, see GitHub's 148 | documentation on [forking](https://help.github.com/articles/fork-a-repo) and 149 | [pull requests](https://help.github.com/articles/using-pull-requests). Pull 150 | requests should be targeted at the `master` branch. Before creating a pull 151 | request, go through this checklist: 152 | 153 | 1. Create a feature branch off of `master` so that changes do not get mixed up. 154 | 1. [Rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) your local 155 | changes against the `master` branch. 156 | 1. Run the full project test suite with the `go test -tags sqlite ./...` (or 157 | equivalent) command and confirm that it passes. 158 | 1. Run `make format` 159 | 1. Add a descriptive prefix to commits. This ensures a uniform commit history 160 | and helps structure the changelog. Please refer to this 161 | [Convential Commits configuration](https://github.com/ory/oathkeeper-client-go/blob/master/.github/workflows/conventional_commits.yml) 162 | for the list of accepted prefixes. You can read more about the Conventional 163 | Commit specification 164 | [at their site](https://www.conventionalcommits.org/en/v1.0.0/). 165 | 166 | If a pull request is not ready to be reviewed yet 167 | [it should be marked as a "Draft"](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request). 168 | 169 | Before your contributions can be reviewed you need to sign our 170 | [Contributor License Agreement](https://cla-assistant.io/ory/oathkeeper-client-go). 171 | 172 | This agreement defines the terms under which your code is contributed to Ory. 173 | More specifically it declares that you have the right to, and actually do, grant 174 | us the rights to use your contribution. You can see the Apache 2.0 license under 175 | which our projects are published 176 | [here](https://github.com/ory/meta/blob/master/LICENSE). 177 | 178 | When pull requests fail the automated testing stages (for example unit or E2E 179 | tests), authors are expected to update their pull requests to address the 180 | failures until the tests pass. 181 | 182 | Pull requests eligible for review 183 | 184 | 1. follow the repository's code formatting conventions; 185 | 2. include tests that prove that the change works as intended and does not add 186 | regressions; 187 | 3. document the changes in the code and/or the project's documentation; 188 | 4. pass the CI pipeline; 189 | 5. have signed our 190 | [Contributor License Agreement](https://cla-assistant.io/ory/oathkeeper-client-go); 191 | 6. include a proper git commit message following the 192 | [Conventional Commit Specification](https://www.conventionalcommits.org/en/v1.0.0/). 193 | 194 | If all of these items are checked, the pull request is ready to be reviewed and 195 | you should change the status to "Ready for review" and 196 | [request review from a maintainer](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review). 197 | 198 | Reviewers will approve the pull request once they are satisfied with the patch. 199 | 200 | ## Contribute documentation 201 | 202 | Please provide documentation when changing, removing, or adding features. All 203 | Ory Documentation resides in the 204 | [Ory documentation repository](https://github.com/ory/docs/). For further 205 | instructions please head over to the Ory Documentation 206 | [README.md](https://github.com/ory/docs/blob/master/README.md). 207 | 208 | ## Disclosing vulnerabilities 209 | 210 | Please disclose vulnerabilities exclusively to 211 | [security@ory.sh](mailto:security@ory.sh). Do not use GitHub issues. 212 | 213 | ## Code style 214 | 215 | Please run `make format` to format all source code following the Ory standard. 216 | 217 | ### Working with forks 218 | 219 | ```bash 220 | # First you clone the original repository 221 | git clone git@github.com:ory/ory/oathkeeper-client-go.git 222 | 223 | # Next you add a git remote that is your fork: 224 | git remote add fork git@github.com:/ory/oathkeeper-client-go.git 225 | 226 | # Next you fetch the latest changes from origin for master: 227 | git fetch origin 228 | git checkout master 229 | git pull --rebase 230 | 231 | # Next you create a new feature branch off of master: 232 | git checkout my-feature-branch 233 | 234 | # Now you do your work and commit your changes: 235 | git add -A 236 | git commit -a -m "fix: this is the subject line" -m "This is the body line. Closes #123" 237 | 238 | # And the last step is pushing this to your fork 239 | git push -u fork my-feature-branch 240 | ``` 241 | 242 | Now go to the project's GitHub Pull Request page and click "New pull request" 243 | 244 | ## Conduct 245 | 246 | Whether you are a regular contributor or a newcomer, we care about making this 247 | community a safe place for you and we've got your back. 248 | 249 | [Ory Community Code of Conduct](https://github.com/ory/oathkeeper-client-go/blob/master/CODE_OF_CONDUCT.md) 250 | 251 | We welcome discussion about creating a welcoming, safe, and productive 252 | environment for the community. If you have any questions, feedback, or concerns 253 | [please let us know](https://www.ory.sh/chat). 254 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ory/oathkeeper-client-go 2 | 3 | This is the official Ory Oathkeeper SDK for go. 4 | 5 | ## Ory Self-Hosted 6 | 7 | This SDK is for use with self-hosted Ory Oathkeeper. 8 | If you are developing against Ory Network, please use the [Ory Network SDK](https://www.ory.sh/docs/sdk). 9 | 10 | 11 | 12 | Please do not make any pull requests against this repository! Its contents are 13 | fully auto-generated by the [ory/sdk](http://github.com/ory/sdk) repository. Any 14 | changes to this repository will be overwritten on the next CI run! 15 | 16 | ## Installation 17 | 18 | package repository is missing, please open an issue about this. 19 | 20 | ## Documentation 21 | 22 | - [Ory Network](https://www.ory.sh/docs/sdk) 23 | - [Ory Hydra](https://www.ory.sh/hydra/docs/sdk) 24 | - [Ory Kratos](https://www.ory.sh/kratos/docs/sdk) 25 | - [Ory Keto](https://www.ory.sh/keto/docs/sdk) 26 | - [Ory Oathkeeper](https://www.ory.sh/oathkeeper/docs/sdk) 27 | 28 | ## Generation 29 | 30 | This code base, including this README, is auto-generated using 31 | [OpenAPI Generator](https://openapi-generator.tech). If you find bugs in the SDK 32 | please check if there is an open issue at 33 | [OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator) 34 | or [ory/sdk](http://github.com/ory/sdk) already before opening an issue here. 35 | 36 | ## Feedback 37 | 38 | If you have feedback on how to improve the Ory SDK or are 39 | [looking to contribute](https://www.ory.sh/docs/ecosystem/contributing), please 40 | [open an issue](https://github.com/ory/sdk/issues/new/choose) in `ory/sdk` to 41 | discuss your ideas. 42 | 43 | Thanks for being a part of the Ory community! 44 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # Ory Security Policy 5 | 6 | This policy outlines Ory's security commitments and practices for users across 7 | different licensing and deployment models. 8 | 9 | To learn more about Ory's security service level agreements (SLAs) and 10 | processes, please [contact us](https://www.ory.sh/contact/). 11 | 12 | ## Ory Network Users 13 | 14 | - **Security SLA:** Ory addresses vulnerabilities in the Ory Network according 15 | to the following guidelines: 16 | - Critical: Typically addressed within 14 days. 17 | - High: Typically addressed within 30 days. 18 | - Medium: Typically addressed within 90 days. 19 | - Low: Typically addressed within 180 days. 20 | - Informational: Addressed as necessary. 21 | These timelines are targets and may vary based on specific circumstances. 22 | - **Release Schedule:** Updates are deployed to the Ory Network as 23 | vulnerabilities are resolved. 24 | - **Version Support:** The Ory Network always runs the latest version, ensuring 25 | up-to-date security fixes. 26 | 27 | ## Ory Enterprise License Customers 28 | 29 | - **Security SLA:** Ory addresses vulnerabilities based on their severity: 30 | - Critical: Typically addressed within 14 days. 31 | - High: Typically addressed within 30 days. 32 | - Medium: Typically addressed within 90 days. 33 | - Low: Typically addressed within 180 days. 34 | - Informational: Addressed as necessary. 35 | These timelines are targets and may vary based on specific circumstances. 36 | - **Release Schedule:** Updates are made available as vulnerabilities are 37 | resolved. Ory works closely with enterprise customers to ensure timely updates 38 | that align with their operational needs. 39 | - **Version Support:** Ory may provide security support for multiple versions, 40 | depending on the terms of the enterprise agreement. 41 | 42 | ## Apache 2.0 License Users 43 | 44 | - **Security SLA:** Ory does not provide a formal SLA for security issues under 45 | the Apache 2.0 License. 46 | - **Release Schedule:** Releases prioritize new functionality and include fixes 47 | for known security vulnerabilities at the time of release. While major 48 | releases typically occur one to two times per year, Ory does not guarantee a 49 | fixed release schedule. 50 | - **Version Support:** Security patches are only provided for the latest release 51 | version. 52 | 53 | ## Reporting a Vulnerability 54 | 55 | For details on how to report security vulnerabilities, visit our 56 | [security policy documentation](https://www.ory.sh/docs/ecosystem/security). 57 | -------------------------------------------------------------------------------- /api_health.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "bytes" 16 | "context" 17 | "io" 18 | "net/http" 19 | "net/url" 20 | ) 21 | 22 | 23 | type HealthAPI interface { 24 | 25 | /* 26 | IsInstanceAlive Check alive status 27 | 28 | This endpoint returns a 200 status code when the HTTP server is up running. 29 | This status does currently not include checks whether the database connection is working. 30 | 31 | If the service supports TLS Edge Termination, this endpoint does not require the 32 | `X-Forwarded-Proto` header to be set. 33 | 34 | Be aware that if you are running multiple nodes of this service, the health status will never 35 | refer to the cluster state, only to a single instance. 36 | 37 | @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 38 | @return HealthAPIIsInstanceAliveRequest 39 | */ 40 | IsInstanceAlive(ctx context.Context) HealthAPIIsInstanceAliveRequest 41 | 42 | // IsInstanceAliveExecute executes the request 43 | // @return HealthStatus 44 | IsInstanceAliveExecute(r HealthAPIIsInstanceAliveRequest) (*HealthStatus, *http.Response, error) 45 | 46 | /* 47 | IsInstanceReady Check readiness status 48 | 49 | This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. 50 | the database) are responsive as well. 51 | 52 | If the service supports TLS Edge Termination, this endpoint does not require the 53 | `X-Forwarded-Proto` header to be set. 54 | 55 | Be aware that if you are running multiple nodes of this service, the health status will never 56 | refer to the cluster state, only to a single instance. 57 | 58 | @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 59 | @return HealthAPIIsInstanceReadyRequest 60 | */ 61 | IsInstanceReady(ctx context.Context) HealthAPIIsInstanceReadyRequest 62 | 63 | // IsInstanceReadyExecute executes the request 64 | // @return HealthStatus 65 | IsInstanceReadyExecute(r HealthAPIIsInstanceReadyRequest) (*HealthStatus, *http.Response, error) 66 | } 67 | 68 | // HealthAPIService HealthAPI service 69 | type HealthAPIService service 70 | 71 | type HealthAPIIsInstanceAliveRequest struct { 72 | ctx context.Context 73 | ApiService HealthAPI 74 | } 75 | 76 | func (r HealthAPIIsInstanceAliveRequest) Execute() (*HealthStatus, *http.Response, error) { 77 | return r.ApiService.IsInstanceAliveExecute(r) 78 | } 79 | 80 | /* 81 | IsInstanceAlive Check alive status 82 | 83 | This endpoint returns a 200 status code when the HTTP server is up running. 84 | This status does currently not include checks whether the database connection is working. 85 | 86 | If the service supports TLS Edge Termination, this endpoint does not require the 87 | `X-Forwarded-Proto` header to be set. 88 | 89 | Be aware that if you are running multiple nodes of this service, the health status will never 90 | refer to the cluster state, only to a single instance. 91 | 92 | @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 93 | @return HealthAPIIsInstanceAliveRequest 94 | */ 95 | func (a *HealthAPIService) IsInstanceAlive(ctx context.Context) HealthAPIIsInstanceAliveRequest { 96 | return HealthAPIIsInstanceAliveRequest{ 97 | ApiService: a, 98 | ctx: ctx, 99 | } 100 | } 101 | 102 | // Execute executes the request 103 | // @return HealthStatus 104 | func (a *HealthAPIService) IsInstanceAliveExecute(r HealthAPIIsInstanceAliveRequest) (*HealthStatus, *http.Response, error) { 105 | var ( 106 | localVarHTTPMethod = http.MethodGet 107 | localVarPostBody interface{} 108 | formFiles []formFile 109 | localVarReturnValue *HealthStatus 110 | ) 111 | 112 | localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HealthAPIService.IsInstanceAlive") 113 | if err != nil { 114 | return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} 115 | } 116 | 117 | localVarPath := localBasePath + "/health/alive" 118 | 119 | localVarHeaderParams := make(map[string]string) 120 | localVarQueryParams := url.Values{} 121 | localVarFormParams := url.Values{} 122 | 123 | // to determine the Content-Type header 124 | localVarHTTPContentTypes := []string{} 125 | 126 | // set Content-Type header 127 | localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) 128 | if localVarHTTPContentType != "" { 129 | localVarHeaderParams["Content-Type"] = localVarHTTPContentType 130 | } 131 | 132 | // to determine the Accept header 133 | localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} 134 | 135 | // set Accept header 136 | localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) 137 | if localVarHTTPHeaderAccept != "" { 138 | localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept 139 | } 140 | req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) 141 | if err != nil { 142 | return localVarReturnValue, nil, err 143 | } 144 | 145 | localVarHTTPResponse, err := a.client.callAPI(req) 146 | if err != nil || localVarHTTPResponse == nil { 147 | return localVarReturnValue, localVarHTTPResponse, err 148 | } 149 | 150 | localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) 151 | localVarHTTPResponse.Body.Close() 152 | localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) 153 | if err != nil { 154 | return localVarReturnValue, localVarHTTPResponse, err 155 | } 156 | 157 | if localVarHTTPResponse.StatusCode >= 300 { 158 | newErr := &GenericOpenAPIError{ 159 | body: localVarBody, 160 | error: localVarHTTPResponse.Status, 161 | } 162 | var v string 163 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 164 | if err != nil { 165 | newErr.error = err.Error() 166 | return localVarReturnValue, localVarHTTPResponse, newErr 167 | } 168 | newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) 169 | newErr.model = v 170 | return localVarReturnValue, localVarHTTPResponse, newErr 171 | } 172 | 173 | err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 174 | if err != nil { 175 | newErr := &GenericOpenAPIError{ 176 | body: localVarBody, 177 | error: err.Error(), 178 | } 179 | return localVarReturnValue, localVarHTTPResponse, newErr 180 | } 181 | 182 | return localVarReturnValue, localVarHTTPResponse, nil 183 | } 184 | 185 | type HealthAPIIsInstanceReadyRequest struct { 186 | ctx context.Context 187 | ApiService HealthAPI 188 | } 189 | 190 | func (r HealthAPIIsInstanceReadyRequest) Execute() (*HealthStatus, *http.Response, error) { 191 | return r.ApiService.IsInstanceReadyExecute(r) 192 | } 193 | 194 | /* 195 | IsInstanceReady Check readiness status 196 | 197 | This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. 198 | the database) are responsive as well. 199 | 200 | If the service supports TLS Edge Termination, this endpoint does not require the 201 | `X-Forwarded-Proto` header to be set. 202 | 203 | Be aware that if you are running multiple nodes of this service, the health status will never 204 | refer to the cluster state, only to a single instance. 205 | 206 | @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 207 | @return HealthAPIIsInstanceReadyRequest 208 | */ 209 | func (a *HealthAPIService) IsInstanceReady(ctx context.Context) HealthAPIIsInstanceReadyRequest { 210 | return HealthAPIIsInstanceReadyRequest{ 211 | ApiService: a, 212 | ctx: ctx, 213 | } 214 | } 215 | 216 | // Execute executes the request 217 | // @return HealthStatus 218 | func (a *HealthAPIService) IsInstanceReadyExecute(r HealthAPIIsInstanceReadyRequest) (*HealthStatus, *http.Response, error) { 219 | var ( 220 | localVarHTTPMethod = http.MethodGet 221 | localVarPostBody interface{} 222 | formFiles []formFile 223 | localVarReturnValue *HealthStatus 224 | ) 225 | 226 | localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HealthAPIService.IsInstanceReady") 227 | if err != nil { 228 | return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} 229 | } 230 | 231 | localVarPath := localBasePath + "/health/ready" 232 | 233 | localVarHeaderParams := make(map[string]string) 234 | localVarQueryParams := url.Values{} 235 | localVarFormParams := url.Values{} 236 | 237 | // to determine the Content-Type header 238 | localVarHTTPContentTypes := []string{} 239 | 240 | // set Content-Type header 241 | localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) 242 | if localVarHTTPContentType != "" { 243 | localVarHeaderParams["Content-Type"] = localVarHTTPContentType 244 | } 245 | 246 | // to determine the Accept header 247 | localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} 248 | 249 | // set Accept header 250 | localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) 251 | if localVarHTTPHeaderAccept != "" { 252 | localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept 253 | } 254 | req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) 255 | if err != nil { 256 | return localVarReturnValue, nil, err 257 | } 258 | 259 | localVarHTTPResponse, err := a.client.callAPI(req) 260 | if err != nil || localVarHTTPResponse == nil { 261 | return localVarReturnValue, localVarHTTPResponse, err 262 | } 263 | 264 | localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) 265 | localVarHTTPResponse.Body.Close() 266 | localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) 267 | if err != nil { 268 | return localVarReturnValue, localVarHTTPResponse, err 269 | } 270 | 271 | if localVarHTTPResponse.StatusCode >= 300 { 272 | newErr := &GenericOpenAPIError{ 273 | body: localVarBody, 274 | error: localVarHTTPResponse.Status, 275 | } 276 | if localVarHTTPResponse.StatusCode == 503 { 277 | var v HealthNotReadyStatus 278 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 279 | if err != nil { 280 | newErr.error = err.Error() 281 | return localVarReturnValue, localVarHTTPResponse, newErr 282 | } 283 | newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) 284 | newErr.model = v 285 | return localVarReturnValue, localVarHTTPResponse, newErr 286 | } 287 | var v string 288 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 289 | if err != nil { 290 | newErr.error = err.Error() 291 | return localVarReturnValue, localVarHTTPResponse, newErr 292 | } 293 | newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) 294 | newErr.model = v 295 | return localVarReturnValue, localVarHTTPResponse, newErr 296 | } 297 | 298 | err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 299 | if err != nil { 300 | newErr := &GenericOpenAPIError{ 301 | body: localVarBody, 302 | error: err.Error(), 303 | } 304 | return localVarReturnValue, localVarHTTPResponse, newErr 305 | } 306 | 307 | return localVarReturnValue, localVarHTTPResponse, nil 308 | } 309 | -------------------------------------------------------------------------------- /api_version.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "bytes" 16 | "context" 17 | "io" 18 | "net/http" 19 | "net/url" 20 | ) 21 | 22 | 23 | type VersionAPI interface { 24 | 25 | /* 26 | GetVersion Get service version 27 | 28 | This endpoint returns the service version typically notated using semantic versioning. 29 | 30 | If the service supports TLS Edge Termination, this endpoint does not require the 31 | `X-Forwarded-Proto` header to be set. 32 | 33 | Be aware that if you are running multiple nodes of this service, the health status will never 34 | refer to the cluster state, only to a single instance. 35 | 36 | @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 37 | @return VersionAPIGetVersionRequest 38 | */ 39 | GetVersion(ctx context.Context) VersionAPIGetVersionRequest 40 | 41 | // GetVersionExecute executes the request 42 | // @return Version 43 | GetVersionExecute(r VersionAPIGetVersionRequest) (*Version, *http.Response, error) 44 | } 45 | 46 | // VersionAPIService VersionAPI service 47 | type VersionAPIService service 48 | 49 | type VersionAPIGetVersionRequest struct { 50 | ctx context.Context 51 | ApiService VersionAPI 52 | } 53 | 54 | func (r VersionAPIGetVersionRequest) Execute() (*Version, *http.Response, error) { 55 | return r.ApiService.GetVersionExecute(r) 56 | } 57 | 58 | /* 59 | GetVersion Get service version 60 | 61 | This endpoint returns the service version typically notated using semantic versioning. 62 | 63 | If the service supports TLS Edge Termination, this endpoint does not require the 64 | `X-Forwarded-Proto` header to be set. 65 | 66 | Be aware that if you are running multiple nodes of this service, the health status will never 67 | refer to the cluster state, only to a single instance. 68 | 69 | @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 70 | @return VersionAPIGetVersionRequest 71 | */ 72 | func (a *VersionAPIService) GetVersion(ctx context.Context) VersionAPIGetVersionRequest { 73 | return VersionAPIGetVersionRequest{ 74 | ApiService: a, 75 | ctx: ctx, 76 | } 77 | } 78 | 79 | // Execute executes the request 80 | // @return Version 81 | func (a *VersionAPIService) GetVersionExecute(r VersionAPIGetVersionRequest) (*Version, *http.Response, error) { 82 | var ( 83 | localVarHTTPMethod = http.MethodGet 84 | localVarPostBody interface{} 85 | formFiles []formFile 86 | localVarReturnValue *Version 87 | ) 88 | 89 | localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VersionAPIService.GetVersion") 90 | if err != nil { 91 | return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} 92 | } 93 | 94 | localVarPath := localBasePath + "/version" 95 | 96 | localVarHeaderParams := make(map[string]string) 97 | localVarQueryParams := url.Values{} 98 | localVarFormParams := url.Values{} 99 | 100 | // to determine the Content-Type header 101 | localVarHTTPContentTypes := []string{} 102 | 103 | // set Content-Type header 104 | localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) 105 | if localVarHTTPContentType != "" { 106 | localVarHeaderParams["Content-Type"] = localVarHTTPContentType 107 | } 108 | 109 | // to determine the Accept header 110 | localVarHTTPHeaderAccepts := []string{"application/json"} 111 | 112 | // set Accept header 113 | localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) 114 | if localVarHTTPHeaderAccept != "" { 115 | localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept 116 | } 117 | req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) 118 | if err != nil { 119 | return localVarReturnValue, nil, err 120 | } 121 | 122 | localVarHTTPResponse, err := a.client.callAPI(req) 123 | if err != nil || localVarHTTPResponse == nil { 124 | return localVarReturnValue, localVarHTTPResponse, err 125 | } 126 | 127 | localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) 128 | localVarHTTPResponse.Body.Close() 129 | localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) 130 | if err != nil { 131 | return localVarReturnValue, localVarHTTPResponse, err 132 | } 133 | 134 | if localVarHTTPResponse.StatusCode >= 300 { 135 | newErr := &GenericOpenAPIError{ 136 | body: localVarBody, 137 | error: localVarHTTPResponse.Status, 138 | } 139 | return localVarReturnValue, localVarHTTPResponse, newErr 140 | } 141 | 142 | err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 143 | if err != nil { 144 | newErr := &GenericOpenAPIError{ 145 | body: localVarBody, 146 | error: err.Error(), 147 | } 148 | return localVarReturnValue, localVarHTTPResponse, newErr 149 | } 150 | 151 | return localVarReturnValue, localVarHTTPResponse, nil 152 | } 153 | -------------------------------------------------------------------------------- /configuration.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "context" 16 | "fmt" 17 | "net/http" 18 | "strings" 19 | ) 20 | 21 | // contextKeys are used to identify the type of value in the context. 22 | // Since these are string, it is possible to get a short description of the 23 | // context key for logging and debugging using key.String(). 24 | 25 | type contextKey string 26 | 27 | func (c contextKey) String() string { 28 | return "auth " + string(c) 29 | } 30 | 31 | var ( 32 | // ContextServerIndex uses a server configuration from the index. 33 | ContextServerIndex = contextKey("serverIndex") 34 | 35 | // ContextOperationServerIndices uses a server configuration from the index mapping. 36 | ContextOperationServerIndices = contextKey("serverOperationIndices") 37 | 38 | // ContextServerVariables overrides a server configuration variables. 39 | ContextServerVariables = contextKey("serverVariables") 40 | 41 | // ContextOperationServerVariables overrides a server configuration variables using operation specific values. 42 | ContextOperationServerVariables = contextKey("serverOperationVariables") 43 | ) 44 | 45 | // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth 46 | type BasicAuth struct { 47 | UserName string `json:"userName,omitempty"` 48 | Password string `json:"password,omitempty"` 49 | } 50 | 51 | // APIKey provides API key based authentication to a request passed via context using ContextAPIKey 52 | type APIKey struct { 53 | Key string 54 | Prefix string 55 | } 56 | 57 | // ServerVariable stores the information about a server variable 58 | type ServerVariable struct { 59 | Description string 60 | DefaultValue string 61 | EnumValues []string 62 | } 63 | 64 | // ServerConfiguration stores the information about a server 65 | type ServerConfiguration struct { 66 | URL string 67 | Description string 68 | Variables map[string]ServerVariable 69 | } 70 | 71 | // ServerConfigurations stores multiple ServerConfiguration items 72 | type ServerConfigurations []ServerConfiguration 73 | 74 | // Configuration stores the configuration of the API client 75 | type Configuration struct { 76 | Host string `json:"host,omitempty"` 77 | Scheme string `json:"scheme,omitempty"` 78 | DefaultHeader map[string]string `json:"defaultHeader,omitempty"` 79 | UserAgent string `json:"userAgent,omitempty"` 80 | Debug bool `json:"debug,omitempty"` 81 | Servers ServerConfigurations 82 | OperationServers map[string]ServerConfigurations 83 | HTTPClient *http.Client 84 | } 85 | 86 | // NewConfiguration returns a new Configuration object 87 | func NewConfiguration() *Configuration { 88 | cfg := &Configuration{ 89 | DefaultHeader: make(map[string]string), 90 | UserAgent: "OpenAPI-Generator/1.0.0/go", 91 | Debug: false, 92 | Servers: ServerConfigurations{ 93 | { 94 | URL: "", 95 | Description: "No description provided", 96 | }, 97 | }, 98 | OperationServers: map[string]ServerConfigurations{ 99 | }, 100 | } 101 | return cfg 102 | } 103 | 104 | // AddDefaultHeader adds a new HTTP header to the default header in the request 105 | func (c *Configuration) AddDefaultHeader(key string, value string) { 106 | c.DefaultHeader[key] = value 107 | } 108 | 109 | // URL formats template on a index using given variables 110 | func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { 111 | if index < 0 || len(sc) <= index { 112 | return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) 113 | } 114 | server := sc[index] 115 | url := server.URL 116 | 117 | // go through variables and replace placeholders 118 | for name, variable := range server.Variables { 119 | if value, ok := variables[name]; ok { 120 | found := bool(len(variable.EnumValues) == 0) 121 | for _, enumValue := range variable.EnumValues { 122 | if value == enumValue { 123 | found = true 124 | } 125 | } 126 | if !found { 127 | return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) 128 | } 129 | url = strings.Replace(url, "{"+name+"}", value, -1) 130 | } else { 131 | url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) 132 | } 133 | } 134 | return url, nil 135 | } 136 | 137 | // ServerURL returns URL based on server settings 138 | func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { 139 | return c.Servers.URL(index, variables) 140 | } 141 | 142 | func getServerIndex(ctx context.Context) (int, error) { 143 | si := ctx.Value(ContextServerIndex) 144 | if si != nil { 145 | if index, ok := si.(int); ok { 146 | return index, nil 147 | } 148 | return 0, reportError("Invalid type %T should be int", si) 149 | } 150 | return 0, nil 151 | } 152 | 153 | func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { 154 | osi := ctx.Value(ContextOperationServerIndices) 155 | if osi != nil { 156 | if operationIndices, ok := osi.(map[string]int); !ok { 157 | return 0, reportError("Invalid type %T should be map[string]int", osi) 158 | } else { 159 | index, ok := operationIndices[endpoint] 160 | if ok { 161 | return index, nil 162 | } 163 | } 164 | } 165 | return getServerIndex(ctx) 166 | } 167 | 168 | func getServerVariables(ctx context.Context) (map[string]string, error) { 169 | sv := ctx.Value(ContextServerVariables) 170 | if sv != nil { 171 | if variables, ok := sv.(map[string]string); ok { 172 | return variables, nil 173 | } 174 | return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) 175 | } 176 | return nil, nil 177 | } 178 | 179 | func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { 180 | osv := ctx.Value(ContextOperationServerVariables) 181 | if osv != nil { 182 | if operationVariables, ok := osv.(map[string]map[string]string); !ok { 183 | return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) 184 | } else { 185 | variables, ok := operationVariables[endpoint] 186 | if ok { 187 | return variables, nil 188 | } 189 | } 190 | } 191 | return getServerVariables(ctx) 192 | } 193 | 194 | // ServerURLWithContext returns a new server URL given an endpoint 195 | func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { 196 | sc, ok := c.OperationServers[endpoint] 197 | if !ok { 198 | sc = c.Servers 199 | } 200 | 201 | if ctx == nil { 202 | return sc.URL(0, nil) 203 | } 204 | 205 | index, err := getServerOperationIndex(ctx, endpoint) 206 | if err != nil { 207 | return "", err 208 | } 209 | 210 | variables, err := getServerOperationVariables(ctx, endpoint) 211 | if err != nil { 212 | return "", err 213 | } 214 | 215 | return sc.URL(index, variables) 216 | } 217 | -------------------------------------------------------------------------------- /docs/ApiAPI.md: -------------------------------------------------------------------------------- 1 | # \ApiAPI 2 | 3 | All URIs are relative to *http://localhost* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**Decisions**](ApiAPI.md#Decisions) | **Get** /decisions | Access Control Decision API 8 | [**GetRule**](ApiAPI.md#GetRule) | **Get** /rules/{id} | Retrieve a Rule 9 | [**GetWellKnownJSONWebKeys**](ApiAPI.md#GetWellKnownJSONWebKeys) | **Get** /.well-known/jwks.json | Lists Cryptographic Keys 10 | [**ListRules**](ApiAPI.md#ListRules) | **Get** /rules | List All Rules 11 | 12 | 13 | 14 | ## Decisions 15 | 16 | > Decisions(ctx).Execute() 17 | 18 | Access Control Decision API 19 | 20 | 21 | 22 | ### Example 23 | 24 | ```go 25 | package main 26 | 27 | import ( 28 | "context" 29 | "fmt" 30 | "os" 31 | openapiclient "github.com/ory/oathkeeper-client-go" 32 | ) 33 | 34 | func main() { 35 | 36 | configuration := openapiclient.NewConfiguration() 37 | apiClient := openapiclient.NewAPIClient(configuration) 38 | r, err := apiClient.ApiAPI.Decisions(context.Background()).Execute() 39 | if err != nil { 40 | fmt.Fprintf(os.Stderr, "Error when calling `ApiAPI.Decisions``: %v\n", err) 41 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 42 | } 43 | } 44 | ``` 45 | 46 | ### Path Parameters 47 | 48 | This endpoint does not need any parameter. 49 | 50 | ### Other Parameters 51 | 52 | Other parameters are passed through a pointer to a apiDecisionsRequest struct via the builder pattern 53 | 54 | 55 | ### Return type 56 | 57 | (empty response body) 58 | 59 | ### Authorization 60 | 61 | No authorization required 62 | 63 | ### HTTP request headers 64 | 65 | - **Content-Type**: Not defined 66 | - **Accept**: application/json 67 | 68 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 69 | [[Back to Model list]](../README.md#documentation-for-models) 70 | [[Back to README]](../README.md) 71 | 72 | 73 | ## GetRule 74 | 75 | > Rule GetRule(ctx, id).Execute() 76 | 77 | Retrieve a Rule 78 | 79 | 80 | 81 | ### Example 82 | 83 | ```go 84 | package main 85 | 86 | import ( 87 | "context" 88 | "fmt" 89 | "os" 90 | openapiclient "github.com/ory/oathkeeper-client-go" 91 | ) 92 | 93 | func main() { 94 | id := "id_example" // string | 95 | 96 | configuration := openapiclient.NewConfiguration() 97 | apiClient := openapiclient.NewAPIClient(configuration) 98 | resp, r, err := apiClient.ApiAPI.GetRule(context.Background(), id).Execute() 99 | if err != nil { 100 | fmt.Fprintf(os.Stderr, "Error when calling `ApiAPI.GetRule``: %v\n", err) 101 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 102 | } 103 | // response from `GetRule`: Rule 104 | fmt.Fprintf(os.Stdout, "Response from `ApiAPI.GetRule`: %v\n", resp) 105 | } 106 | ``` 107 | 108 | ### Path Parameters 109 | 110 | 111 | Name | Type | Description | Notes 112 | ------------- | ------------- | ------------- | ------------- 113 | **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 114 | **id** | **string** | | 115 | 116 | ### Other Parameters 117 | 118 | Other parameters are passed through a pointer to a apiGetRuleRequest struct via the builder pattern 119 | 120 | 121 | Name | Type | Description | Notes 122 | ------------- | ------------- | ------------- | ------------- 123 | 124 | 125 | ### Return type 126 | 127 | [**Rule**](Rule.md) 128 | 129 | ### Authorization 130 | 131 | No authorization required 132 | 133 | ### HTTP request headers 134 | 135 | - **Content-Type**: Not defined 136 | - **Accept**: application/json 137 | 138 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 139 | [[Back to Model list]](../README.md#documentation-for-models) 140 | [[Back to README]](../README.md) 141 | 142 | 143 | ## GetWellKnownJSONWebKeys 144 | 145 | > JsonWebKeySet GetWellKnownJSONWebKeys(ctx).Execute() 146 | 147 | Lists Cryptographic Keys 148 | 149 | 150 | 151 | ### Example 152 | 153 | ```go 154 | package main 155 | 156 | import ( 157 | "context" 158 | "fmt" 159 | "os" 160 | openapiclient "github.com/ory/oathkeeper-client-go" 161 | ) 162 | 163 | func main() { 164 | 165 | configuration := openapiclient.NewConfiguration() 166 | apiClient := openapiclient.NewAPIClient(configuration) 167 | resp, r, err := apiClient.ApiAPI.GetWellKnownJSONWebKeys(context.Background()).Execute() 168 | if err != nil { 169 | fmt.Fprintf(os.Stderr, "Error when calling `ApiAPI.GetWellKnownJSONWebKeys``: %v\n", err) 170 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 171 | } 172 | // response from `GetWellKnownJSONWebKeys`: JsonWebKeySet 173 | fmt.Fprintf(os.Stdout, "Response from `ApiAPI.GetWellKnownJSONWebKeys`: %v\n", resp) 174 | } 175 | ``` 176 | 177 | ### Path Parameters 178 | 179 | This endpoint does not need any parameter. 180 | 181 | ### Other Parameters 182 | 183 | Other parameters are passed through a pointer to a apiGetWellKnownJSONWebKeysRequest struct via the builder pattern 184 | 185 | 186 | ### Return type 187 | 188 | [**JsonWebKeySet**](JsonWebKeySet.md) 189 | 190 | ### Authorization 191 | 192 | No authorization required 193 | 194 | ### HTTP request headers 195 | 196 | - **Content-Type**: Not defined 197 | - **Accept**: application/json 198 | 199 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 200 | [[Back to Model list]](../README.md#documentation-for-models) 201 | [[Back to README]](../README.md) 202 | 203 | 204 | ## ListRules 205 | 206 | > []Rule ListRules(ctx).Limit(limit).Offset(offset).Execute() 207 | 208 | List All Rules 209 | 210 | 211 | 212 | ### Example 213 | 214 | ```go 215 | package main 216 | 217 | import ( 218 | "context" 219 | "fmt" 220 | "os" 221 | openapiclient "github.com/ory/oathkeeper-client-go" 222 | ) 223 | 224 | func main() { 225 | limit := int64(789) // int64 | The maximum amount of rules returned. (optional) 226 | offset := int64(789) // int64 | The offset from where to start looking. (optional) 227 | 228 | configuration := openapiclient.NewConfiguration() 229 | apiClient := openapiclient.NewAPIClient(configuration) 230 | resp, r, err := apiClient.ApiAPI.ListRules(context.Background()).Limit(limit).Offset(offset).Execute() 231 | if err != nil { 232 | fmt.Fprintf(os.Stderr, "Error when calling `ApiAPI.ListRules``: %v\n", err) 233 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 234 | } 235 | // response from `ListRules`: []Rule 236 | fmt.Fprintf(os.Stdout, "Response from `ApiAPI.ListRules`: %v\n", resp) 237 | } 238 | ``` 239 | 240 | ### Path Parameters 241 | 242 | 243 | 244 | ### Other Parameters 245 | 246 | Other parameters are passed through a pointer to a apiListRulesRequest struct via the builder pattern 247 | 248 | 249 | Name | Type | Description | Notes 250 | ------------- | ------------- | ------------- | ------------- 251 | **limit** | **int64** | The maximum amount of rules returned. | 252 | **offset** | **int64** | The offset from where to start looking. | 253 | 254 | ### Return type 255 | 256 | [**[]Rule**](Rule.md) 257 | 258 | ### Authorization 259 | 260 | No authorization required 261 | 262 | ### HTTP request headers 263 | 264 | - **Content-Type**: Not defined 265 | - **Accept**: application/json 266 | 267 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 268 | [[Back to Model list]](../README.md#documentation-for-models) 269 | [[Back to README]](../README.md) 270 | 271 | -------------------------------------------------------------------------------- /docs/GenericError.md: -------------------------------------------------------------------------------- 1 | # GenericError 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Code** | Pointer to **int64** | | [optional] 8 | **Details** | Pointer to **[]map[string]map[string]interface{}** | | [optional] 9 | **Message** | Pointer to **string** | | [optional] 10 | **Reason** | Pointer to **string** | | [optional] 11 | **Request** | Pointer to **string** | | [optional] 12 | **Status** | Pointer to **string** | | [optional] 13 | 14 | ## Methods 15 | 16 | ### NewGenericError 17 | 18 | `func NewGenericError() *GenericError` 19 | 20 | NewGenericError instantiates a new GenericError object 21 | This constructor will assign default values to properties that have it defined, 22 | and makes sure properties required by API are set, but the set of arguments 23 | will change when the set of required properties is changed 24 | 25 | ### NewGenericErrorWithDefaults 26 | 27 | `func NewGenericErrorWithDefaults() *GenericError` 28 | 29 | NewGenericErrorWithDefaults instantiates a new GenericError object 30 | This constructor will only assign default values to properties that have it defined, 31 | but it doesn't guarantee that properties required by API are set 32 | 33 | ### GetCode 34 | 35 | `func (o *GenericError) GetCode() int64` 36 | 37 | GetCode returns the Code field if non-nil, zero value otherwise. 38 | 39 | ### GetCodeOk 40 | 41 | `func (o *GenericError) GetCodeOk() (*int64, bool)` 42 | 43 | GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise 44 | and a boolean to check if the value has been set. 45 | 46 | ### SetCode 47 | 48 | `func (o *GenericError) SetCode(v int64)` 49 | 50 | SetCode sets Code field to given value. 51 | 52 | ### HasCode 53 | 54 | `func (o *GenericError) HasCode() bool` 55 | 56 | HasCode returns a boolean if a field has been set. 57 | 58 | ### GetDetails 59 | 60 | `func (o *GenericError) GetDetails() []map[string]map[string]interface{}` 61 | 62 | GetDetails returns the Details field if non-nil, zero value otherwise. 63 | 64 | ### GetDetailsOk 65 | 66 | `func (o *GenericError) GetDetailsOk() (*[]map[string]map[string]interface{}, bool)` 67 | 68 | GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise 69 | and a boolean to check if the value has been set. 70 | 71 | ### SetDetails 72 | 73 | `func (o *GenericError) SetDetails(v []map[string]map[string]interface{})` 74 | 75 | SetDetails sets Details field to given value. 76 | 77 | ### HasDetails 78 | 79 | `func (o *GenericError) HasDetails() bool` 80 | 81 | HasDetails returns a boolean if a field has been set. 82 | 83 | ### GetMessage 84 | 85 | `func (o *GenericError) GetMessage() string` 86 | 87 | GetMessage returns the Message field if non-nil, zero value otherwise. 88 | 89 | ### GetMessageOk 90 | 91 | `func (o *GenericError) GetMessageOk() (*string, bool)` 92 | 93 | GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise 94 | and a boolean to check if the value has been set. 95 | 96 | ### SetMessage 97 | 98 | `func (o *GenericError) SetMessage(v string)` 99 | 100 | SetMessage sets Message field to given value. 101 | 102 | ### HasMessage 103 | 104 | `func (o *GenericError) HasMessage() bool` 105 | 106 | HasMessage returns a boolean if a field has been set. 107 | 108 | ### GetReason 109 | 110 | `func (o *GenericError) GetReason() string` 111 | 112 | GetReason returns the Reason field if non-nil, zero value otherwise. 113 | 114 | ### GetReasonOk 115 | 116 | `func (o *GenericError) GetReasonOk() (*string, bool)` 117 | 118 | GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value otherwise 119 | and a boolean to check if the value has been set. 120 | 121 | ### SetReason 122 | 123 | `func (o *GenericError) SetReason(v string)` 124 | 125 | SetReason sets Reason field to given value. 126 | 127 | ### HasReason 128 | 129 | `func (o *GenericError) HasReason() bool` 130 | 131 | HasReason returns a boolean if a field has been set. 132 | 133 | ### GetRequest 134 | 135 | `func (o *GenericError) GetRequest() string` 136 | 137 | GetRequest returns the Request field if non-nil, zero value otherwise. 138 | 139 | ### GetRequestOk 140 | 141 | `func (o *GenericError) GetRequestOk() (*string, bool)` 142 | 143 | GetRequestOk returns a tuple with the Request field if it's non-nil, zero value otherwise 144 | and a boolean to check if the value has been set. 145 | 146 | ### SetRequest 147 | 148 | `func (o *GenericError) SetRequest(v string)` 149 | 150 | SetRequest sets Request field to given value. 151 | 152 | ### HasRequest 153 | 154 | `func (o *GenericError) HasRequest() bool` 155 | 156 | HasRequest returns a boolean if a field has been set. 157 | 158 | ### GetStatus 159 | 160 | `func (o *GenericError) GetStatus() string` 161 | 162 | GetStatus returns the Status field if non-nil, zero value otherwise. 163 | 164 | ### GetStatusOk 165 | 166 | `func (o *GenericError) GetStatusOk() (*string, bool)` 167 | 168 | GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise 169 | and a boolean to check if the value has been set. 170 | 171 | ### SetStatus 172 | 173 | `func (o *GenericError) SetStatus(v string)` 174 | 175 | SetStatus sets Status field to given value. 176 | 177 | ### HasStatus 178 | 179 | `func (o *GenericError) HasStatus() bool` 180 | 181 | HasStatus returns a boolean if a field has been set. 182 | 183 | 184 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 185 | 186 | 187 | -------------------------------------------------------------------------------- /docs/HealthAPI.md: -------------------------------------------------------------------------------- 1 | # \HealthAPI 2 | 3 | All URIs are relative to *http://localhost* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**IsInstanceAlive**](HealthAPI.md#IsInstanceAlive) | **Get** /health/alive | Check alive status 8 | [**IsInstanceReady**](HealthAPI.md#IsInstanceReady) | **Get** /health/ready | Check readiness status 9 | 10 | 11 | 12 | ## IsInstanceAlive 13 | 14 | > HealthStatus IsInstanceAlive(ctx).Execute() 15 | 16 | Check alive status 17 | 18 | 19 | 20 | ### Example 21 | 22 | ```go 23 | package main 24 | 25 | import ( 26 | "context" 27 | "fmt" 28 | "os" 29 | openapiclient "github.com/ory/oathkeeper-client-go" 30 | ) 31 | 32 | func main() { 33 | 34 | configuration := openapiclient.NewConfiguration() 35 | apiClient := openapiclient.NewAPIClient(configuration) 36 | resp, r, err := apiClient.HealthAPI.IsInstanceAlive(context.Background()).Execute() 37 | if err != nil { 38 | fmt.Fprintf(os.Stderr, "Error when calling `HealthAPI.IsInstanceAlive``: %v\n", err) 39 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 40 | } 41 | // response from `IsInstanceAlive`: HealthStatus 42 | fmt.Fprintf(os.Stdout, "Response from `HealthAPI.IsInstanceAlive`: %v\n", resp) 43 | } 44 | ``` 45 | 46 | ### Path Parameters 47 | 48 | This endpoint does not need any parameter. 49 | 50 | ### Other Parameters 51 | 52 | Other parameters are passed through a pointer to a apiIsInstanceAliveRequest struct via the builder pattern 53 | 54 | 55 | ### Return type 56 | 57 | [**HealthStatus**](HealthStatus.md) 58 | 59 | ### Authorization 60 | 61 | No authorization required 62 | 63 | ### HTTP request headers 64 | 65 | - **Content-Type**: Not defined 66 | - **Accept**: application/json, text/plain 67 | 68 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 69 | [[Back to Model list]](../README.md#documentation-for-models) 70 | [[Back to README]](../README.md) 71 | 72 | 73 | ## IsInstanceReady 74 | 75 | > HealthStatus IsInstanceReady(ctx).Execute() 76 | 77 | Check readiness status 78 | 79 | 80 | 81 | ### Example 82 | 83 | ```go 84 | package main 85 | 86 | import ( 87 | "context" 88 | "fmt" 89 | "os" 90 | openapiclient "github.com/ory/oathkeeper-client-go" 91 | ) 92 | 93 | func main() { 94 | 95 | configuration := openapiclient.NewConfiguration() 96 | apiClient := openapiclient.NewAPIClient(configuration) 97 | resp, r, err := apiClient.HealthAPI.IsInstanceReady(context.Background()).Execute() 98 | if err != nil { 99 | fmt.Fprintf(os.Stderr, "Error when calling `HealthAPI.IsInstanceReady``: %v\n", err) 100 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 101 | } 102 | // response from `IsInstanceReady`: HealthStatus 103 | fmt.Fprintf(os.Stdout, "Response from `HealthAPI.IsInstanceReady`: %v\n", resp) 104 | } 105 | ``` 106 | 107 | ### Path Parameters 108 | 109 | This endpoint does not need any parameter. 110 | 111 | ### Other Parameters 112 | 113 | Other parameters are passed through a pointer to a apiIsInstanceReadyRequest struct via the builder pattern 114 | 115 | 116 | ### Return type 117 | 118 | [**HealthStatus**](HealthStatus.md) 119 | 120 | ### Authorization 121 | 122 | No authorization required 123 | 124 | ### HTTP request headers 125 | 126 | - **Content-Type**: Not defined 127 | - **Accept**: application/json, text/plain 128 | 129 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 130 | [[Back to Model list]](../README.md#documentation-for-models) 131 | [[Back to README]](../README.md) 132 | 133 | -------------------------------------------------------------------------------- /docs/HealthNotReadyStatus.md: -------------------------------------------------------------------------------- 1 | # HealthNotReadyStatus 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Errors** | Pointer to **map[string]string** | Errors contains a list of errors that caused the not ready status. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewHealthNotReadyStatus 12 | 13 | `func NewHealthNotReadyStatus() *HealthNotReadyStatus` 14 | 15 | NewHealthNotReadyStatus instantiates a new HealthNotReadyStatus object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewHealthNotReadyStatusWithDefaults 21 | 22 | `func NewHealthNotReadyStatusWithDefaults() *HealthNotReadyStatus` 23 | 24 | NewHealthNotReadyStatusWithDefaults instantiates a new HealthNotReadyStatus object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetErrors 29 | 30 | `func (o *HealthNotReadyStatus) GetErrors() map[string]string` 31 | 32 | GetErrors returns the Errors field if non-nil, zero value otherwise. 33 | 34 | ### GetErrorsOk 35 | 36 | `func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool)` 37 | 38 | GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetErrors 42 | 43 | `func (o *HealthNotReadyStatus) SetErrors(v map[string]string)` 44 | 45 | SetErrors sets Errors field to given value. 46 | 47 | ### HasErrors 48 | 49 | `func (o *HealthNotReadyStatus) HasErrors() bool` 50 | 51 | HasErrors returns a boolean if a field has been set. 52 | 53 | 54 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 55 | 56 | 57 | -------------------------------------------------------------------------------- /docs/HealthStatus.md: -------------------------------------------------------------------------------- 1 | # HealthStatus 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Status** | Pointer to **string** | Status always contains \"ok\". | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewHealthStatus 12 | 13 | `func NewHealthStatus() *HealthStatus` 14 | 15 | NewHealthStatus instantiates a new HealthStatus object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewHealthStatusWithDefaults 21 | 22 | `func NewHealthStatusWithDefaults() *HealthStatus` 23 | 24 | NewHealthStatusWithDefaults instantiates a new HealthStatus object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetStatus 29 | 30 | `func (o *HealthStatus) GetStatus() string` 31 | 32 | GetStatus returns the Status field if non-nil, zero value otherwise. 33 | 34 | ### GetStatusOk 35 | 36 | `func (o *HealthStatus) GetStatusOk() (*string, bool)` 37 | 38 | GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetStatus 42 | 43 | `func (o *HealthStatus) SetStatus(v string)` 44 | 45 | SetStatus sets Status field to given value. 46 | 47 | ### HasStatus 48 | 49 | `func (o *HealthStatus) HasStatus() bool` 50 | 51 | HasStatus returns a boolean if a field has been set. 52 | 53 | 54 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 55 | 56 | 57 | -------------------------------------------------------------------------------- /docs/JsonWebKeySet.md: -------------------------------------------------------------------------------- 1 | # JsonWebKeySet 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Keys** | Pointer to [**[]JsonWebKey**](JsonWebKey.md) | The value of the \"keys\" parameter is an array of JWK values. By default, the order of the JWK values within the array does not imply an order of preference among them, although applications of JWK Sets can choose to assign a meaning to the order for their purposes, if desired. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewJsonWebKeySet 12 | 13 | `func NewJsonWebKeySet() *JsonWebKeySet` 14 | 15 | NewJsonWebKeySet instantiates a new JsonWebKeySet object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewJsonWebKeySetWithDefaults 21 | 22 | `func NewJsonWebKeySetWithDefaults() *JsonWebKeySet` 23 | 24 | NewJsonWebKeySetWithDefaults instantiates a new JsonWebKeySet object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetKeys 29 | 30 | `func (o *JsonWebKeySet) GetKeys() []JsonWebKey` 31 | 32 | GetKeys returns the Keys field if non-nil, zero value otherwise. 33 | 34 | ### GetKeysOk 35 | 36 | `func (o *JsonWebKeySet) GetKeysOk() (*[]JsonWebKey, bool)` 37 | 38 | GetKeysOk returns a tuple with the Keys field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetKeys 42 | 43 | `func (o *JsonWebKeySet) SetKeys(v []JsonWebKey)` 44 | 45 | SetKeys sets Keys field to given value. 46 | 47 | ### HasKeys 48 | 49 | `func (o *JsonWebKeySet) HasKeys() bool` 50 | 51 | HasKeys returns a boolean if a field has been set. 52 | 53 | 54 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 55 | 56 | 57 | -------------------------------------------------------------------------------- /docs/Rule.md: -------------------------------------------------------------------------------- 1 | # Rule 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Authenticators** | Pointer to [**[]RuleHandler**](RuleHandler.md) | Authenticators is a list of authentication handlers that will try and authenticate the provided credentials. Authenticators are checked iteratively from index 0 to n and if the first authenticator to return a positive result will be the one used. If you want the rule to first check a specific authenticator before \"falling back\" to others, have that authenticator as the first item in the array. | [optional] 8 | **Authorizer** | Pointer to [**RuleHandler**](RuleHandler.md) | | [optional] 9 | **Description** | Pointer to **string** | Description is a human readable description of this rule. | [optional] 10 | **Id** | Pointer to **string** | ID is the unique id of the rule. It can be at most 190 characters long, but the layout of the ID is up to you. You will need this ID later on to update or delete the rule. | [optional] 11 | **Match** | Pointer to [**RuleMatch**](RuleMatch.md) | | [optional] 12 | **Mutators** | Pointer to [**[]RuleHandler**](RuleHandler.md) | Mutators is a list of mutation handlers that transform the HTTP request. A common use case is generating a new set of credentials (e.g. JWT) which then will be forwarded to the upstream server. Mutations are performed iteratively from index 0 to n and should all succeed in order for the HTTP request to be forwarded. | [optional] 13 | **Upstream** | Pointer to [**Upstream**](Upstream.md) | | [optional] 14 | 15 | ## Methods 16 | 17 | ### NewRule 18 | 19 | `func NewRule() *Rule` 20 | 21 | NewRule instantiates a new Rule object 22 | This constructor will assign default values to properties that have it defined, 23 | and makes sure properties required by API are set, but the set of arguments 24 | will change when the set of required properties is changed 25 | 26 | ### NewRuleWithDefaults 27 | 28 | `func NewRuleWithDefaults() *Rule` 29 | 30 | NewRuleWithDefaults instantiates a new Rule object 31 | This constructor will only assign default values to properties that have it defined, 32 | but it doesn't guarantee that properties required by API are set 33 | 34 | ### GetAuthenticators 35 | 36 | `func (o *Rule) GetAuthenticators() []RuleHandler` 37 | 38 | GetAuthenticators returns the Authenticators field if non-nil, zero value otherwise. 39 | 40 | ### GetAuthenticatorsOk 41 | 42 | `func (o *Rule) GetAuthenticatorsOk() (*[]RuleHandler, bool)` 43 | 44 | GetAuthenticatorsOk returns a tuple with the Authenticators field if it's non-nil, zero value otherwise 45 | and a boolean to check if the value has been set. 46 | 47 | ### SetAuthenticators 48 | 49 | `func (o *Rule) SetAuthenticators(v []RuleHandler)` 50 | 51 | SetAuthenticators sets Authenticators field to given value. 52 | 53 | ### HasAuthenticators 54 | 55 | `func (o *Rule) HasAuthenticators() bool` 56 | 57 | HasAuthenticators returns a boolean if a field has been set. 58 | 59 | ### GetAuthorizer 60 | 61 | `func (o *Rule) GetAuthorizer() RuleHandler` 62 | 63 | GetAuthorizer returns the Authorizer field if non-nil, zero value otherwise. 64 | 65 | ### GetAuthorizerOk 66 | 67 | `func (o *Rule) GetAuthorizerOk() (*RuleHandler, bool)` 68 | 69 | GetAuthorizerOk returns a tuple with the Authorizer field if it's non-nil, zero value otherwise 70 | and a boolean to check if the value has been set. 71 | 72 | ### SetAuthorizer 73 | 74 | `func (o *Rule) SetAuthorizer(v RuleHandler)` 75 | 76 | SetAuthorizer sets Authorizer field to given value. 77 | 78 | ### HasAuthorizer 79 | 80 | `func (o *Rule) HasAuthorizer() bool` 81 | 82 | HasAuthorizer returns a boolean if a field has been set. 83 | 84 | ### GetDescription 85 | 86 | `func (o *Rule) GetDescription() string` 87 | 88 | GetDescription returns the Description field if non-nil, zero value otherwise. 89 | 90 | ### GetDescriptionOk 91 | 92 | `func (o *Rule) GetDescriptionOk() (*string, bool)` 93 | 94 | GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise 95 | and a boolean to check if the value has been set. 96 | 97 | ### SetDescription 98 | 99 | `func (o *Rule) SetDescription(v string)` 100 | 101 | SetDescription sets Description field to given value. 102 | 103 | ### HasDescription 104 | 105 | `func (o *Rule) HasDescription() bool` 106 | 107 | HasDescription returns a boolean if a field has been set. 108 | 109 | ### GetId 110 | 111 | `func (o *Rule) GetId() string` 112 | 113 | GetId returns the Id field if non-nil, zero value otherwise. 114 | 115 | ### GetIdOk 116 | 117 | `func (o *Rule) GetIdOk() (*string, bool)` 118 | 119 | GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise 120 | and a boolean to check if the value has been set. 121 | 122 | ### SetId 123 | 124 | `func (o *Rule) SetId(v string)` 125 | 126 | SetId sets Id field to given value. 127 | 128 | ### HasId 129 | 130 | `func (o *Rule) HasId() bool` 131 | 132 | HasId returns a boolean if a field has been set. 133 | 134 | ### GetMatch 135 | 136 | `func (o *Rule) GetMatch() RuleMatch` 137 | 138 | GetMatch returns the Match field if non-nil, zero value otherwise. 139 | 140 | ### GetMatchOk 141 | 142 | `func (o *Rule) GetMatchOk() (*RuleMatch, bool)` 143 | 144 | GetMatchOk returns a tuple with the Match field if it's non-nil, zero value otherwise 145 | and a boolean to check if the value has been set. 146 | 147 | ### SetMatch 148 | 149 | `func (o *Rule) SetMatch(v RuleMatch)` 150 | 151 | SetMatch sets Match field to given value. 152 | 153 | ### HasMatch 154 | 155 | `func (o *Rule) HasMatch() bool` 156 | 157 | HasMatch returns a boolean if a field has been set. 158 | 159 | ### GetMutators 160 | 161 | `func (o *Rule) GetMutators() []RuleHandler` 162 | 163 | GetMutators returns the Mutators field if non-nil, zero value otherwise. 164 | 165 | ### GetMutatorsOk 166 | 167 | `func (o *Rule) GetMutatorsOk() (*[]RuleHandler, bool)` 168 | 169 | GetMutatorsOk returns a tuple with the Mutators field if it's non-nil, zero value otherwise 170 | and a boolean to check if the value has been set. 171 | 172 | ### SetMutators 173 | 174 | `func (o *Rule) SetMutators(v []RuleHandler)` 175 | 176 | SetMutators sets Mutators field to given value. 177 | 178 | ### HasMutators 179 | 180 | `func (o *Rule) HasMutators() bool` 181 | 182 | HasMutators returns a boolean if a field has been set. 183 | 184 | ### GetUpstream 185 | 186 | `func (o *Rule) GetUpstream() Upstream` 187 | 188 | GetUpstream returns the Upstream field if non-nil, zero value otherwise. 189 | 190 | ### GetUpstreamOk 191 | 192 | `func (o *Rule) GetUpstreamOk() (*Upstream, bool)` 193 | 194 | GetUpstreamOk returns a tuple with the Upstream field if it's non-nil, zero value otherwise 195 | and a boolean to check if the value has been set. 196 | 197 | ### SetUpstream 198 | 199 | `func (o *Rule) SetUpstream(v Upstream)` 200 | 201 | SetUpstream sets Upstream field to given value. 202 | 203 | ### HasUpstream 204 | 205 | `func (o *Rule) HasUpstream() bool` 206 | 207 | HasUpstream returns a boolean if a field has been set. 208 | 209 | 210 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 211 | 212 | 213 | -------------------------------------------------------------------------------- /docs/RuleHandler.md: -------------------------------------------------------------------------------- 1 | # RuleHandler 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Config** | Pointer to **map[string]interface{}** | Config contains the configuration for the handler. Please read the user guide for a complete list of each handler's available settings. | [optional] 8 | **Handler** | Pointer to **string** | Handler identifies the implementation which will be used to handle this specific request. Please read the user guide for a complete list of available handlers. | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewRuleHandler 13 | 14 | `func NewRuleHandler() *RuleHandler` 15 | 16 | NewRuleHandler instantiates a new RuleHandler object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewRuleHandlerWithDefaults 22 | 23 | `func NewRuleHandlerWithDefaults() *RuleHandler` 24 | 25 | NewRuleHandlerWithDefaults instantiates a new RuleHandler object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetConfig 30 | 31 | `func (o *RuleHandler) GetConfig() map[string]interface{}` 32 | 33 | GetConfig returns the Config field if non-nil, zero value otherwise. 34 | 35 | ### GetConfigOk 36 | 37 | `func (o *RuleHandler) GetConfigOk() (*map[string]interface{}, bool)` 38 | 39 | GetConfigOk returns a tuple with the Config field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetConfig 43 | 44 | `func (o *RuleHandler) SetConfig(v map[string]interface{})` 45 | 46 | SetConfig sets Config field to given value. 47 | 48 | ### HasConfig 49 | 50 | `func (o *RuleHandler) HasConfig() bool` 51 | 52 | HasConfig returns a boolean if a field has been set. 53 | 54 | ### GetHandler 55 | 56 | `func (o *RuleHandler) GetHandler() string` 57 | 58 | GetHandler returns the Handler field if non-nil, zero value otherwise. 59 | 60 | ### GetHandlerOk 61 | 62 | `func (o *RuleHandler) GetHandlerOk() (*string, bool)` 63 | 64 | GetHandlerOk returns a tuple with the Handler field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetHandler 68 | 69 | `func (o *RuleHandler) SetHandler(v string)` 70 | 71 | SetHandler sets Handler field to given value. 72 | 73 | ### HasHandler 74 | 75 | `func (o *RuleHandler) HasHandler() bool` 76 | 77 | HasHandler returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/RuleMatch.md: -------------------------------------------------------------------------------- 1 | # RuleMatch 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Methods** | Pointer to **[]string** | An array of HTTP methods (e.g. GET, POST, PUT, DELETE, ...). When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the HTTP method of the incoming request with the HTTP methods of each rules. If a match is found, the rule is considered a partial match. If the matchesUrl field is satisfied as well, the rule is considered a full match. | [optional] 8 | **Url** | Pointer to **string** | This field represents the URL pattern this rule matches. When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the full request URL (e.g. https://mydomain.com/api/resource) without query parameters of the incoming request with this field. If a match is found, the rule is considered a partial match. If the matchesMethods field is satisfied as well, the rule is considered a full match. You can use regular expressions in this field to match more than one url. Regular expressions are encapsulated in brackets < and >. The following example matches all paths of the domain `mydomain.com`: `https://mydomain.com/<.*>`. | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewRuleMatch 13 | 14 | `func NewRuleMatch() *RuleMatch` 15 | 16 | NewRuleMatch instantiates a new RuleMatch object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewRuleMatchWithDefaults 22 | 23 | `func NewRuleMatchWithDefaults() *RuleMatch` 24 | 25 | NewRuleMatchWithDefaults instantiates a new RuleMatch object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetMethods 30 | 31 | `func (o *RuleMatch) GetMethods() []string` 32 | 33 | GetMethods returns the Methods field if non-nil, zero value otherwise. 34 | 35 | ### GetMethodsOk 36 | 37 | `func (o *RuleMatch) GetMethodsOk() (*[]string, bool)` 38 | 39 | GetMethodsOk returns a tuple with the Methods field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetMethods 43 | 44 | `func (o *RuleMatch) SetMethods(v []string)` 45 | 46 | SetMethods sets Methods field to given value. 47 | 48 | ### HasMethods 49 | 50 | `func (o *RuleMatch) HasMethods() bool` 51 | 52 | HasMethods returns a boolean if a field has been set. 53 | 54 | ### GetUrl 55 | 56 | `func (o *RuleMatch) GetUrl() string` 57 | 58 | GetUrl returns the Url field if non-nil, zero value otherwise. 59 | 60 | ### GetUrlOk 61 | 62 | `func (o *RuleMatch) GetUrlOk() (*string, bool)` 63 | 64 | GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetUrl 68 | 69 | `func (o *RuleMatch) SetUrl(v string)` 70 | 71 | SetUrl sets Url field to given value. 72 | 73 | ### HasUrl 74 | 75 | `func (o *RuleMatch) HasUrl() bool` 76 | 77 | HasUrl returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/Upstream.md: -------------------------------------------------------------------------------- 1 | # Upstream 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **PreserveHost** | Pointer to **bool** | PreserveHost, if false (the default), tells ORY Oathkeeper to set the upstream request's Host header to the hostname of the API's upstream's URL. Setting this flag to true instructs ORY Oathkeeper not to do so. | [optional] 8 | **StripPath** | Pointer to **string** | StripPath if set, replaces the provided path prefix when forwarding the requested URL to the upstream URL. | [optional] 9 | **Url** | Pointer to **string** | URL is the URL the request will be proxied to. | [optional] 10 | 11 | ## Methods 12 | 13 | ### NewUpstream 14 | 15 | `func NewUpstream() *Upstream` 16 | 17 | NewUpstream instantiates a new Upstream object 18 | This constructor will assign default values to properties that have it defined, 19 | and makes sure properties required by API are set, but the set of arguments 20 | will change when the set of required properties is changed 21 | 22 | ### NewUpstreamWithDefaults 23 | 24 | `func NewUpstreamWithDefaults() *Upstream` 25 | 26 | NewUpstreamWithDefaults instantiates a new Upstream object 27 | This constructor will only assign default values to properties that have it defined, 28 | but it doesn't guarantee that properties required by API are set 29 | 30 | ### GetPreserveHost 31 | 32 | `func (o *Upstream) GetPreserveHost() bool` 33 | 34 | GetPreserveHost returns the PreserveHost field if non-nil, zero value otherwise. 35 | 36 | ### GetPreserveHostOk 37 | 38 | `func (o *Upstream) GetPreserveHostOk() (*bool, bool)` 39 | 40 | GetPreserveHostOk returns a tuple with the PreserveHost field if it's non-nil, zero value otherwise 41 | and a boolean to check if the value has been set. 42 | 43 | ### SetPreserveHost 44 | 45 | `func (o *Upstream) SetPreserveHost(v bool)` 46 | 47 | SetPreserveHost sets PreserveHost field to given value. 48 | 49 | ### HasPreserveHost 50 | 51 | `func (o *Upstream) HasPreserveHost() bool` 52 | 53 | HasPreserveHost returns a boolean if a field has been set. 54 | 55 | ### GetStripPath 56 | 57 | `func (o *Upstream) GetStripPath() string` 58 | 59 | GetStripPath returns the StripPath field if non-nil, zero value otherwise. 60 | 61 | ### GetStripPathOk 62 | 63 | `func (o *Upstream) GetStripPathOk() (*string, bool)` 64 | 65 | GetStripPathOk returns a tuple with the StripPath field if it's non-nil, zero value otherwise 66 | and a boolean to check if the value has been set. 67 | 68 | ### SetStripPath 69 | 70 | `func (o *Upstream) SetStripPath(v string)` 71 | 72 | SetStripPath sets StripPath field to given value. 73 | 74 | ### HasStripPath 75 | 76 | `func (o *Upstream) HasStripPath() bool` 77 | 78 | HasStripPath returns a boolean if a field has been set. 79 | 80 | ### GetUrl 81 | 82 | `func (o *Upstream) GetUrl() string` 83 | 84 | GetUrl returns the Url field if non-nil, zero value otherwise. 85 | 86 | ### GetUrlOk 87 | 88 | `func (o *Upstream) GetUrlOk() (*string, bool)` 89 | 90 | GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise 91 | and a boolean to check if the value has been set. 92 | 93 | ### SetUrl 94 | 95 | `func (o *Upstream) SetUrl(v string)` 96 | 97 | SetUrl sets Url field to given value. 98 | 99 | ### HasUrl 100 | 101 | `func (o *Upstream) HasUrl() bool` 102 | 103 | HasUrl returns a boolean if a field has been set. 104 | 105 | 106 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/Version.md: -------------------------------------------------------------------------------- 1 | # Version 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Version** | Pointer to **string** | Version is the service's version. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewVersion 12 | 13 | `func NewVersion() *Version` 14 | 15 | NewVersion instantiates a new Version object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewVersionWithDefaults 21 | 22 | `func NewVersionWithDefaults() *Version` 23 | 24 | NewVersionWithDefaults instantiates a new Version object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetVersion 29 | 30 | `func (o *Version) GetVersion() string` 31 | 32 | GetVersion returns the Version field if non-nil, zero value otherwise. 33 | 34 | ### GetVersionOk 35 | 36 | `func (o *Version) GetVersionOk() (*string, bool)` 37 | 38 | GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetVersion 42 | 43 | `func (o *Version) SetVersion(v string)` 44 | 45 | SetVersion sets Version field to given value. 46 | 47 | ### HasVersion 48 | 49 | `func (o *Version) HasVersion() bool` 50 | 51 | HasVersion returns a boolean if a field has been set. 52 | 53 | 54 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 55 | 56 | 57 | -------------------------------------------------------------------------------- /docs/VersionAPI.md: -------------------------------------------------------------------------------- 1 | # \VersionAPI 2 | 3 | All URIs are relative to *http://localhost* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**GetVersion**](VersionAPI.md#GetVersion) | **Get** /version | Get service version 8 | 9 | 10 | 11 | ## GetVersion 12 | 13 | > Version GetVersion(ctx).Execute() 14 | 15 | Get service version 16 | 17 | 18 | 19 | ### Example 20 | 21 | ```go 22 | package main 23 | 24 | import ( 25 | "context" 26 | "fmt" 27 | "os" 28 | openapiclient "github.com/ory/oathkeeper-client-go" 29 | ) 30 | 31 | func main() { 32 | 33 | configuration := openapiclient.NewConfiguration() 34 | apiClient := openapiclient.NewAPIClient(configuration) 35 | resp, r, err := apiClient.VersionAPI.GetVersion(context.Background()).Execute() 36 | if err != nil { 37 | fmt.Fprintf(os.Stderr, "Error when calling `VersionAPI.GetVersion``: %v\n", err) 38 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 39 | } 40 | // response from `GetVersion`: Version 41 | fmt.Fprintf(os.Stdout, "Response from `VersionAPI.GetVersion`: %v\n", resp) 42 | } 43 | ``` 44 | 45 | ### Path Parameters 46 | 47 | This endpoint does not need any parameter. 48 | 49 | ### Other Parameters 50 | 51 | Other parameters are passed through a pointer to a apiGetVersionRequest struct via the builder pattern 52 | 53 | 54 | ### Return type 55 | 56 | [**Version**](Version.md) 57 | 58 | ### Authorization 59 | 60 | No authorization required 61 | 62 | ### HTTP request headers 63 | 64 | - **Content-Type**: Not defined 65 | - **Accept**: application/json 66 | 67 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 68 | [[Back to Model list]](../README.md#documentation-for-models) 69 | [[Back to README]](../README.md) 70 | 71 | -------------------------------------------------------------------------------- /git_push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 3 | # 4 | # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" 5 | 6 | git_user_id=$1 7 | git_repo_id=$2 8 | release_note=$3 9 | git_host=$4 10 | 11 | if [ "$git_host" = "" ]; then 12 | git_host="github.com" 13 | echo "[INFO] No command line input provided. Set \$git_host to $git_host" 14 | fi 15 | 16 | if [ "$git_user_id" = "" ]; then 17 | git_user_id="ory" 18 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 19 | fi 20 | 21 | if [ "$git_repo_id" = "" ]; then 22 | git_repo_id="oathkeeper-client-go" 23 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 24 | fi 25 | 26 | if [ "$release_note" = "" ]; then 27 | release_note="Minor update" 28 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 29 | fi 30 | 31 | # Initialize the local directory as a Git repository 32 | git init 33 | 34 | # Adds the files in the local repository and stages them for commit. 35 | git add . 36 | 37 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 38 | git commit -m "$release_note" 39 | 40 | # Sets the new remote 41 | git_remote=$(git remote) 42 | if [ "$git_remote" = "" ]; then # git remote not defined 43 | 44 | if [ "$GIT_TOKEN" = "" ]; then 45 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 46 | git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git 47 | else 48 | git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git 49 | fi 50 | 51 | fi 52 | 53 | git pull origin master 54 | 55 | # Pushes (Forces) the changes in the local repository up to the remote repository 56 | echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" 57 | git push origin master 2>&1 | grep -v 'To https' 58 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/ory/oathkeeper-client-go 2 | 3 | go 1.17 4 | 5 | require github.com/stretchr/testify v1.9.0 6 | 7 | require ( 8 | github.com/davecgh/go-spew v1.1.1 // indirect 9 | github.com/pmezard/go-difflib v1.0.0 // indirect 10 | gopkg.in/yaml.v3 v3.0.1 // indirect 11 | ) 12 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 2 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 3 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 4 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 5 | github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= 6 | github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 7 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 8 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 9 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 10 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 11 | -------------------------------------------------------------------------------- /model_generic_error.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | ) 17 | 18 | // checks if the GenericError type satisfies the MappedNullable interface at compile time 19 | var _ MappedNullable = &GenericError{} 20 | 21 | // GenericError The standard error format 22 | type GenericError struct { 23 | Code *int64 `json:"code,omitempty"` 24 | Details []map[string]map[string]interface{} `json:"details,omitempty"` 25 | Message *string `json:"message,omitempty"` 26 | Reason *string `json:"reason,omitempty"` 27 | Request *string `json:"request,omitempty"` 28 | Status *string `json:"status,omitempty"` 29 | AdditionalProperties map[string]interface{} 30 | } 31 | 32 | type _GenericError GenericError 33 | 34 | // NewGenericError instantiates a new GenericError object 35 | // This constructor will assign default values to properties that have it defined, 36 | // and makes sure properties required by API are set, but the set of arguments 37 | // will change when the set of required properties is changed 38 | func NewGenericError() *GenericError { 39 | this := GenericError{} 40 | return &this 41 | } 42 | 43 | // NewGenericErrorWithDefaults instantiates a new GenericError object 44 | // This constructor will only assign default values to properties that have it defined, 45 | // but it doesn't guarantee that properties required by API are set 46 | func NewGenericErrorWithDefaults() *GenericError { 47 | this := GenericError{} 48 | return &this 49 | } 50 | 51 | // GetCode returns the Code field value if set, zero value otherwise. 52 | func (o *GenericError) GetCode() int64 { 53 | if o == nil || IsNil(o.Code) { 54 | var ret int64 55 | return ret 56 | } 57 | return *o.Code 58 | } 59 | 60 | // GetCodeOk returns a tuple with the Code field value if set, nil otherwise 61 | // and a boolean to check if the value has been set. 62 | func (o *GenericError) GetCodeOk() (*int64, bool) { 63 | if o == nil || IsNil(o.Code) { 64 | return nil, false 65 | } 66 | return o.Code, true 67 | } 68 | 69 | // HasCode returns a boolean if a field has been set. 70 | func (o *GenericError) HasCode() bool { 71 | if o != nil && !IsNil(o.Code) { 72 | return true 73 | } 74 | 75 | return false 76 | } 77 | 78 | // SetCode gets a reference to the given int64 and assigns it to the Code field. 79 | func (o *GenericError) SetCode(v int64) { 80 | o.Code = &v 81 | } 82 | 83 | // GetDetails returns the Details field value if set, zero value otherwise. 84 | func (o *GenericError) GetDetails() []map[string]map[string]interface{} { 85 | if o == nil || IsNil(o.Details) { 86 | var ret []map[string]map[string]interface{} 87 | return ret 88 | } 89 | return o.Details 90 | } 91 | 92 | // GetDetailsOk returns a tuple with the Details field value if set, nil otherwise 93 | // and a boolean to check if the value has been set. 94 | func (o *GenericError) GetDetailsOk() ([]map[string]map[string]interface{}, bool) { 95 | if o == nil || IsNil(o.Details) { 96 | return nil, false 97 | } 98 | return o.Details, true 99 | } 100 | 101 | // HasDetails returns a boolean if a field has been set. 102 | func (o *GenericError) HasDetails() bool { 103 | if o != nil && !IsNil(o.Details) { 104 | return true 105 | } 106 | 107 | return false 108 | } 109 | 110 | // SetDetails gets a reference to the given []map[string]map[string]interface{} and assigns it to the Details field. 111 | func (o *GenericError) SetDetails(v []map[string]map[string]interface{}) { 112 | o.Details = v 113 | } 114 | 115 | // GetMessage returns the Message field value if set, zero value otherwise. 116 | func (o *GenericError) GetMessage() string { 117 | if o == nil || IsNil(o.Message) { 118 | var ret string 119 | return ret 120 | } 121 | return *o.Message 122 | } 123 | 124 | // GetMessageOk returns a tuple with the Message field value if set, nil otherwise 125 | // and a boolean to check if the value has been set. 126 | func (o *GenericError) GetMessageOk() (*string, bool) { 127 | if o == nil || IsNil(o.Message) { 128 | return nil, false 129 | } 130 | return o.Message, true 131 | } 132 | 133 | // HasMessage returns a boolean if a field has been set. 134 | func (o *GenericError) HasMessage() bool { 135 | if o != nil && !IsNil(o.Message) { 136 | return true 137 | } 138 | 139 | return false 140 | } 141 | 142 | // SetMessage gets a reference to the given string and assigns it to the Message field. 143 | func (o *GenericError) SetMessage(v string) { 144 | o.Message = &v 145 | } 146 | 147 | // GetReason returns the Reason field value if set, zero value otherwise. 148 | func (o *GenericError) GetReason() string { 149 | if o == nil || IsNil(o.Reason) { 150 | var ret string 151 | return ret 152 | } 153 | return *o.Reason 154 | } 155 | 156 | // GetReasonOk returns a tuple with the Reason field value if set, nil otherwise 157 | // and a boolean to check if the value has been set. 158 | func (o *GenericError) GetReasonOk() (*string, bool) { 159 | if o == nil || IsNil(o.Reason) { 160 | return nil, false 161 | } 162 | return o.Reason, true 163 | } 164 | 165 | // HasReason returns a boolean if a field has been set. 166 | func (o *GenericError) HasReason() bool { 167 | if o != nil && !IsNil(o.Reason) { 168 | return true 169 | } 170 | 171 | return false 172 | } 173 | 174 | // SetReason gets a reference to the given string and assigns it to the Reason field. 175 | func (o *GenericError) SetReason(v string) { 176 | o.Reason = &v 177 | } 178 | 179 | // GetRequest returns the Request field value if set, zero value otherwise. 180 | func (o *GenericError) GetRequest() string { 181 | if o == nil || IsNil(o.Request) { 182 | var ret string 183 | return ret 184 | } 185 | return *o.Request 186 | } 187 | 188 | // GetRequestOk returns a tuple with the Request field value if set, nil otherwise 189 | // and a boolean to check if the value has been set. 190 | func (o *GenericError) GetRequestOk() (*string, bool) { 191 | if o == nil || IsNil(o.Request) { 192 | return nil, false 193 | } 194 | return o.Request, true 195 | } 196 | 197 | // HasRequest returns a boolean if a field has been set. 198 | func (o *GenericError) HasRequest() bool { 199 | if o != nil && !IsNil(o.Request) { 200 | return true 201 | } 202 | 203 | return false 204 | } 205 | 206 | // SetRequest gets a reference to the given string and assigns it to the Request field. 207 | func (o *GenericError) SetRequest(v string) { 208 | o.Request = &v 209 | } 210 | 211 | // GetStatus returns the Status field value if set, zero value otherwise. 212 | func (o *GenericError) GetStatus() string { 213 | if o == nil || IsNil(o.Status) { 214 | var ret string 215 | return ret 216 | } 217 | return *o.Status 218 | } 219 | 220 | // GetStatusOk returns a tuple with the Status field value if set, nil otherwise 221 | // and a boolean to check if the value has been set. 222 | func (o *GenericError) GetStatusOk() (*string, bool) { 223 | if o == nil || IsNil(o.Status) { 224 | return nil, false 225 | } 226 | return o.Status, true 227 | } 228 | 229 | // HasStatus returns a boolean if a field has been set. 230 | func (o *GenericError) HasStatus() bool { 231 | if o != nil && !IsNil(o.Status) { 232 | return true 233 | } 234 | 235 | return false 236 | } 237 | 238 | // SetStatus gets a reference to the given string and assigns it to the Status field. 239 | func (o *GenericError) SetStatus(v string) { 240 | o.Status = &v 241 | } 242 | 243 | func (o GenericError) MarshalJSON() ([]byte, error) { 244 | toSerialize,err := o.ToMap() 245 | if err != nil { 246 | return []byte{}, err 247 | } 248 | return json.Marshal(toSerialize) 249 | } 250 | 251 | func (o GenericError) ToMap() (map[string]interface{}, error) { 252 | toSerialize := map[string]interface{}{} 253 | if !IsNil(o.Code) { 254 | toSerialize["code"] = o.Code 255 | } 256 | if !IsNil(o.Details) { 257 | toSerialize["details"] = o.Details 258 | } 259 | if !IsNil(o.Message) { 260 | toSerialize["message"] = o.Message 261 | } 262 | if !IsNil(o.Reason) { 263 | toSerialize["reason"] = o.Reason 264 | } 265 | if !IsNil(o.Request) { 266 | toSerialize["request"] = o.Request 267 | } 268 | if !IsNil(o.Status) { 269 | toSerialize["status"] = o.Status 270 | } 271 | 272 | for key, value := range o.AdditionalProperties { 273 | toSerialize[key] = value 274 | } 275 | 276 | return toSerialize, nil 277 | } 278 | 279 | func (o *GenericError) UnmarshalJSON(data []byte) (err error) { 280 | varGenericError := _GenericError{} 281 | 282 | err = json.Unmarshal(data, &varGenericError) 283 | 284 | if err != nil { 285 | return err 286 | } 287 | 288 | *o = GenericError(varGenericError) 289 | 290 | additionalProperties := make(map[string]interface{}) 291 | 292 | if err = json.Unmarshal(data, &additionalProperties); err == nil { 293 | delete(additionalProperties, "code") 294 | delete(additionalProperties, "details") 295 | delete(additionalProperties, "message") 296 | delete(additionalProperties, "reason") 297 | delete(additionalProperties, "request") 298 | delete(additionalProperties, "status") 299 | o.AdditionalProperties = additionalProperties 300 | } 301 | 302 | return err 303 | } 304 | 305 | type NullableGenericError struct { 306 | value *GenericError 307 | isSet bool 308 | } 309 | 310 | func (v NullableGenericError) Get() *GenericError { 311 | return v.value 312 | } 313 | 314 | func (v *NullableGenericError) Set(val *GenericError) { 315 | v.value = val 316 | v.isSet = true 317 | } 318 | 319 | func (v NullableGenericError) IsSet() bool { 320 | return v.isSet 321 | } 322 | 323 | func (v *NullableGenericError) Unset() { 324 | v.value = nil 325 | v.isSet = false 326 | } 327 | 328 | func NewNullableGenericError(val *GenericError) *NullableGenericError { 329 | return &NullableGenericError{value: val, isSet: true} 330 | } 331 | 332 | func (v NullableGenericError) MarshalJSON() ([]byte, error) { 333 | return json.Marshal(v.value) 334 | } 335 | 336 | func (v *NullableGenericError) UnmarshalJSON(src []byte) error { 337 | v.isSet = true 338 | return json.Unmarshal(src, &v.value) 339 | } 340 | 341 | 342 | -------------------------------------------------------------------------------- /model_health_not_ready_status.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | ) 17 | 18 | // checks if the HealthNotReadyStatus type satisfies the MappedNullable interface at compile time 19 | var _ MappedNullable = &HealthNotReadyStatus{} 20 | 21 | // HealthNotReadyStatus struct for HealthNotReadyStatus 22 | type HealthNotReadyStatus struct { 23 | // Errors contains a list of errors that caused the not ready status. 24 | Errors *map[string]string `json:"errors,omitempty"` 25 | AdditionalProperties map[string]interface{} 26 | } 27 | 28 | type _HealthNotReadyStatus HealthNotReadyStatus 29 | 30 | // NewHealthNotReadyStatus instantiates a new HealthNotReadyStatus object 31 | // This constructor will assign default values to properties that have it defined, 32 | // and makes sure properties required by API are set, but the set of arguments 33 | // will change when the set of required properties is changed 34 | func NewHealthNotReadyStatus() *HealthNotReadyStatus { 35 | this := HealthNotReadyStatus{} 36 | return &this 37 | } 38 | 39 | // NewHealthNotReadyStatusWithDefaults instantiates a new HealthNotReadyStatus object 40 | // This constructor will only assign default values to properties that have it defined, 41 | // but it doesn't guarantee that properties required by API are set 42 | func NewHealthNotReadyStatusWithDefaults() *HealthNotReadyStatus { 43 | this := HealthNotReadyStatus{} 44 | return &this 45 | } 46 | 47 | // GetErrors returns the Errors field value if set, zero value otherwise. 48 | func (o *HealthNotReadyStatus) GetErrors() map[string]string { 49 | if o == nil || IsNil(o.Errors) { 50 | var ret map[string]string 51 | return ret 52 | } 53 | return *o.Errors 54 | } 55 | 56 | // GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise 57 | // and a boolean to check if the value has been set. 58 | func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool) { 59 | if o == nil || IsNil(o.Errors) { 60 | return nil, false 61 | } 62 | return o.Errors, true 63 | } 64 | 65 | // HasErrors returns a boolean if a field has been set. 66 | func (o *HealthNotReadyStatus) HasErrors() bool { 67 | if o != nil && !IsNil(o.Errors) { 68 | return true 69 | } 70 | 71 | return false 72 | } 73 | 74 | // SetErrors gets a reference to the given map[string]string and assigns it to the Errors field. 75 | func (o *HealthNotReadyStatus) SetErrors(v map[string]string) { 76 | o.Errors = &v 77 | } 78 | 79 | func (o HealthNotReadyStatus) MarshalJSON() ([]byte, error) { 80 | toSerialize,err := o.ToMap() 81 | if err != nil { 82 | return []byte{}, err 83 | } 84 | return json.Marshal(toSerialize) 85 | } 86 | 87 | func (o HealthNotReadyStatus) ToMap() (map[string]interface{}, error) { 88 | toSerialize := map[string]interface{}{} 89 | if !IsNil(o.Errors) { 90 | toSerialize["errors"] = o.Errors 91 | } 92 | 93 | for key, value := range o.AdditionalProperties { 94 | toSerialize[key] = value 95 | } 96 | 97 | return toSerialize, nil 98 | } 99 | 100 | func (o *HealthNotReadyStatus) UnmarshalJSON(data []byte) (err error) { 101 | varHealthNotReadyStatus := _HealthNotReadyStatus{} 102 | 103 | err = json.Unmarshal(data, &varHealthNotReadyStatus) 104 | 105 | if err != nil { 106 | return err 107 | } 108 | 109 | *o = HealthNotReadyStatus(varHealthNotReadyStatus) 110 | 111 | additionalProperties := make(map[string]interface{}) 112 | 113 | if err = json.Unmarshal(data, &additionalProperties); err == nil { 114 | delete(additionalProperties, "errors") 115 | o.AdditionalProperties = additionalProperties 116 | } 117 | 118 | return err 119 | } 120 | 121 | type NullableHealthNotReadyStatus struct { 122 | value *HealthNotReadyStatus 123 | isSet bool 124 | } 125 | 126 | func (v NullableHealthNotReadyStatus) Get() *HealthNotReadyStatus { 127 | return v.value 128 | } 129 | 130 | func (v *NullableHealthNotReadyStatus) Set(val *HealthNotReadyStatus) { 131 | v.value = val 132 | v.isSet = true 133 | } 134 | 135 | func (v NullableHealthNotReadyStatus) IsSet() bool { 136 | return v.isSet 137 | } 138 | 139 | func (v *NullableHealthNotReadyStatus) Unset() { 140 | v.value = nil 141 | v.isSet = false 142 | } 143 | 144 | func NewNullableHealthNotReadyStatus(val *HealthNotReadyStatus) *NullableHealthNotReadyStatus { 145 | return &NullableHealthNotReadyStatus{value: val, isSet: true} 146 | } 147 | 148 | func (v NullableHealthNotReadyStatus) MarshalJSON() ([]byte, error) { 149 | return json.Marshal(v.value) 150 | } 151 | 152 | func (v *NullableHealthNotReadyStatus) UnmarshalJSON(src []byte) error { 153 | v.isSet = true 154 | return json.Unmarshal(src, &v.value) 155 | } 156 | 157 | 158 | -------------------------------------------------------------------------------- /model_health_status.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | ) 17 | 18 | // checks if the HealthStatus type satisfies the MappedNullable interface at compile time 19 | var _ MappedNullable = &HealthStatus{} 20 | 21 | // HealthStatus struct for HealthStatus 22 | type HealthStatus struct { 23 | // Status always contains \"ok\". 24 | Status *string `json:"status,omitempty"` 25 | AdditionalProperties map[string]interface{} 26 | } 27 | 28 | type _HealthStatus HealthStatus 29 | 30 | // NewHealthStatus instantiates a new HealthStatus object 31 | // This constructor will assign default values to properties that have it defined, 32 | // and makes sure properties required by API are set, but the set of arguments 33 | // will change when the set of required properties is changed 34 | func NewHealthStatus() *HealthStatus { 35 | this := HealthStatus{} 36 | return &this 37 | } 38 | 39 | // NewHealthStatusWithDefaults instantiates a new HealthStatus object 40 | // This constructor will only assign default values to properties that have it defined, 41 | // but it doesn't guarantee that properties required by API are set 42 | func NewHealthStatusWithDefaults() *HealthStatus { 43 | this := HealthStatus{} 44 | return &this 45 | } 46 | 47 | // GetStatus returns the Status field value if set, zero value otherwise. 48 | func (o *HealthStatus) GetStatus() string { 49 | if o == nil || IsNil(o.Status) { 50 | var ret string 51 | return ret 52 | } 53 | return *o.Status 54 | } 55 | 56 | // GetStatusOk returns a tuple with the Status field value if set, nil otherwise 57 | // and a boolean to check if the value has been set. 58 | func (o *HealthStatus) GetStatusOk() (*string, bool) { 59 | if o == nil || IsNil(o.Status) { 60 | return nil, false 61 | } 62 | return o.Status, true 63 | } 64 | 65 | // HasStatus returns a boolean if a field has been set. 66 | func (o *HealthStatus) HasStatus() bool { 67 | if o != nil && !IsNil(o.Status) { 68 | return true 69 | } 70 | 71 | return false 72 | } 73 | 74 | // SetStatus gets a reference to the given string and assigns it to the Status field. 75 | func (o *HealthStatus) SetStatus(v string) { 76 | o.Status = &v 77 | } 78 | 79 | func (o HealthStatus) MarshalJSON() ([]byte, error) { 80 | toSerialize,err := o.ToMap() 81 | if err != nil { 82 | return []byte{}, err 83 | } 84 | return json.Marshal(toSerialize) 85 | } 86 | 87 | func (o HealthStatus) ToMap() (map[string]interface{}, error) { 88 | toSerialize := map[string]interface{}{} 89 | if !IsNil(o.Status) { 90 | toSerialize["status"] = o.Status 91 | } 92 | 93 | for key, value := range o.AdditionalProperties { 94 | toSerialize[key] = value 95 | } 96 | 97 | return toSerialize, nil 98 | } 99 | 100 | func (o *HealthStatus) UnmarshalJSON(data []byte) (err error) { 101 | varHealthStatus := _HealthStatus{} 102 | 103 | err = json.Unmarshal(data, &varHealthStatus) 104 | 105 | if err != nil { 106 | return err 107 | } 108 | 109 | *o = HealthStatus(varHealthStatus) 110 | 111 | additionalProperties := make(map[string]interface{}) 112 | 113 | if err = json.Unmarshal(data, &additionalProperties); err == nil { 114 | delete(additionalProperties, "status") 115 | o.AdditionalProperties = additionalProperties 116 | } 117 | 118 | return err 119 | } 120 | 121 | type NullableHealthStatus struct { 122 | value *HealthStatus 123 | isSet bool 124 | } 125 | 126 | func (v NullableHealthStatus) Get() *HealthStatus { 127 | return v.value 128 | } 129 | 130 | func (v *NullableHealthStatus) Set(val *HealthStatus) { 131 | v.value = val 132 | v.isSet = true 133 | } 134 | 135 | func (v NullableHealthStatus) IsSet() bool { 136 | return v.isSet 137 | } 138 | 139 | func (v *NullableHealthStatus) Unset() { 140 | v.value = nil 141 | v.isSet = false 142 | } 143 | 144 | func NewNullableHealthStatus(val *HealthStatus) *NullableHealthStatus { 145 | return &NullableHealthStatus{value: val, isSet: true} 146 | } 147 | 148 | func (v NullableHealthStatus) MarshalJSON() ([]byte, error) { 149 | return json.Marshal(v.value) 150 | } 151 | 152 | func (v *NullableHealthStatus) UnmarshalJSON(src []byte) error { 153 | v.isSet = true 154 | return json.Unmarshal(src, &v.value) 155 | } 156 | 157 | 158 | -------------------------------------------------------------------------------- /model_json_web_key_set.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | ) 17 | 18 | // checks if the JsonWebKeySet type satisfies the MappedNullable interface at compile time 19 | var _ MappedNullable = &JsonWebKeySet{} 20 | 21 | // JsonWebKeySet struct for JsonWebKeySet 22 | type JsonWebKeySet struct { 23 | // The value of the \"keys\" parameter is an array of JWK values. By default, the order of the JWK values within the array does not imply an order of preference among them, although applications of JWK Sets can choose to assign a meaning to the order for their purposes, if desired. 24 | Keys []JsonWebKey `json:"keys,omitempty"` 25 | AdditionalProperties map[string]interface{} 26 | } 27 | 28 | type _JsonWebKeySet JsonWebKeySet 29 | 30 | // NewJsonWebKeySet instantiates a new JsonWebKeySet object 31 | // This constructor will assign default values to properties that have it defined, 32 | // and makes sure properties required by API are set, but the set of arguments 33 | // will change when the set of required properties is changed 34 | func NewJsonWebKeySet() *JsonWebKeySet { 35 | this := JsonWebKeySet{} 36 | return &this 37 | } 38 | 39 | // NewJsonWebKeySetWithDefaults instantiates a new JsonWebKeySet object 40 | // This constructor will only assign default values to properties that have it defined, 41 | // but it doesn't guarantee that properties required by API are set 42 | func NewJsonWebKeySetWithDefaults() *JsonWebKeySet { 43 | this := JsonWebKeySet{} 44 | return &this 45 | } 46 | 47 | // GetKeys returns the Keys field value if set, zero value otherwise. 48 | func (o *JsonWebKeySet) GetKeys() []JsonWebKey { 49 | if o == nil || IsNil(o.Keys) { 50 | var ret []JsonWebKey 51 | return ret 52 | } 53 | return o.Keys 54 | } 55 | 56 | // GetKeysOk returns a tuple with the Keys field value if set, nil otherwise 57 | // and a boolean to check if the value has been set. 58 | func (o *JsonWebKeySet) GetKeysOk() ([]JsonWebKey, bool) { 59 | if o == nil || IsNil(o.Keys) { 60 | return nil, false 61 | } 62 | return o.Keys, true 63 | } 64 | 65 | // HasKeys returns a boolean if a field has been set. 66 | func (o *JsonWebKeySet) HasKeys() bool { 67 | if o != nil && !IsNil(o.Keys) { 68 | return true 69 | } 70 | 71 | return false 72 | } 73 | 74 | // SetKeys gets a reference to the given []JsonWebKey and assigns it to the Keys field. 75 | func (o *JsonWebKeySet) SetKeys(v []JsonWebKey) { 76 | o.Keys = v 77 | } 78 | 79 | func (o JsonWebKeySet) MarshalJSON() ([]byte, error) { 80 | toSerialize,err := o.ToMap() 81 | if err != nil { 82 | return []byte{}, err 83 | } 84 | return json.Marshal(toSerialize) 85 | } 86 | 87 | func (o JsonWebKeySet) ToMap() (map[string]interface{}, error) { 88 | toSerialize := map[string]interface{}{} 89 | if !IsNil(o.Keys) { 90 | toSerialize["keys"] = o.Keys 91 | } 92 | 93 | for key, value := range o.AdditionalProperties { 94 | toSerialize[key] = value 95 | } 96 | 97 | return toSerialize, nil 98 | } 99 | 100 | func (o *JsonWebKeySet) UnmarshalJSON(data []byte) (err error) { 101 | varJsonWebKeySet := _JsonWebKeySet{} 102 | 103 | err = json.Unmarshal(data, &varJsonWebKeySet) 104 | 105 | if err != nil { 106 | return err 107 | } 108 | 109 | *o = JsonWebKeySet(varJsonWebKeySet) 110 | 111 | additionalProperties := make(map[string]interface{}) 112 | 113 | if err = json.Unmarshal(data, &additionalProperties); err == nil { 114 | delete(additionalProperties, "keys") 115 | o.AdditionalProperties = additionalProperties 116 | } 117 | 118 | return err 119 | } 120 | 121 | type NullableJsonWebKeySet struct { 122 | value *JsonWebKeySet 123 | isSet bool 124 | } 125 | 126 | func (v NullableJsonWebKeySet) Get() *JsonWebKeySet { 127 | return v.value 128 | } 129 | 130 | func (v *NullableJsonWebKeySet) Set(val *JsonWebKeySet) { 131 | v.value = val 132 | v.isSet = true 133 | } 134 | 135 | func (v NullableJsonWebKeySet) IsSet() bool { 136 | return v.isSet 137 | } 138 | 139 | func (v *NullableJsonWebKeySet) Unset() { 140 | v.value = nil 141 | v.isSet = false 142 | } 143 | 144 | func NewNullableJsonWebKeySet(val *JsonWebKeySet) *NullableJsonWebKeySet { 145 | return &NullableJsonWebKeySet{value: val, isSet: true} 146 | } 147 | 148 | func (v NullableJsonWebKeySet) MarshalJSON() ([]byte, error) { 149 | return json.Marshal(v.value) 150 | } 151 | 152 | func (v *NullableJsonWebKeySet) UnmarshalJSON(src []byte) error { 153 | v.isSet = true 154 | return json.Unmarshal(src, &v.value) 155 | } 156 | 157 | 158 | -------------------------------------------------------------------------------- /model_rule.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | ) 17 | 18 | // checks if the Rule type satisfies the MappedNullable interface at compile time 19 | var _ MappedNullable = &Rule{} 20 | 21 | // Rule struct for Rule 22 | type Rule struct { 23 | // Authenticators is a list of authentication handlers that will try and authenticate the provided credentials. Authenticators are checked iteratively from index 0 to n and if the first authenticator to return a positive result will be the one used. If you want the rule to first check a specific authenticator before \"falling back\" to others, have that authenticator as the first item in the array. 24 | Authenticators []RuleHandler `json:"authenticators,omitempty"` 25 | Authorizer *RuleHandler `json:"authorizer,omitempty"` 26 | // Description is a human readable description of this rule. 27 | Description *string `json:"description,omitempty"` 28 | // ID is the unique id of the rule. It can be at most 190 characters long, but the layout of the ID is up to you. You will need this ID later on to update or delete the rule. 29 | Id *string `json:"id,omitempty"` 30 | Match *RuleMatch `json:"match,omitempty"` 31 | // Mutators is a list of mutation handlers that transform the HTTP request. A common use case is generating a new set of credentials (e.g. JWT) which then will be forwarded to the upstream server. Mutations are performed iteratively from index 0 to n and should all succeed in order for the HTTP request to be forwarded. 32 | Mutators []RuleHandler `json:"mutators,omitempty"` 33 | Upstream *Upstream `json:"upstream,omitempty"` 34 | AdditionalProperties map[string]interface{} 35 | } 36 | 37 | type _Rule Rule 38 | 39 | // NewRule instantiates a new Rule object 40 | // This constructor will assign default values to properties that have it defined, 41 | // and makes sure properties required by API are set, but the set of arguments 42 | // will change when the set of required properties is changed 43 | func NewRule() *Rule { 44 | this := Rule{} 45 | return &this 46 | } 47 | 48 | // NewRuleWithDefaults instantiates a new Rule object 49 | // This constructor will only assign default values to properties that have it defined, 50 | // but it doesn't guarantee that properties required by API are set 51 | func NewRuleWithDefaults() *Rule { 52 | this := Rule{} 53 | return &this 54 | } 55 | 56 | // GetAuthenticators returns the Authenticators field value if set, zero value otherwise. 57 | func (o *Rule) GetAuthenticators() []RuleHandler { 58 | if o == nil || IsNil(o.Authenticators) { 59 | var ret []RuleHandler 60 | return ret 61 | } 62 | return o.Authenticators 63 | } 64 | 65 | // GetAuthenticatorsOk returns a tuple with the Authenticators field value if set, nil otherwise 66 | // and a boolean to check if the value has been set. 67 | func (o *Rule) GetAuthenticatorsOk() ([]RuleHandler, bool) { 68 | if o == nil || IsNil(o.Authenticators) { 69 | return nil, false 70 | } 71 | return o.Authenticators, true 72 | } 73 | 74 | // HasAuthenticators returns a boolean if a field has been set. 75 | func (o *Rule) HasAuthenticators() bool { 76 | if o != nil && !IsNil(o.Authenticators) { 77 | return true 78 | } 79 | 80 | return false 81 | } 82 | 83 | // SetAuthenticators gets a reference to the given []RuleHandler and assigns it to the Authenticators field. 84 | func (o *Rule) SetAuthenticators(v []RuleHandler) { 85 | o.Authenticators = v 86 | } 87 | 88 | // GetAuthorizer returns the Authorizer field value if set, zero value otherwise. 89 | func (o *Rule) GetAuthorizer() RuleHandler { 90 | if o == nil || IsNil(o.Authorizer) { 91 | var ret RuleHandler 92 | return ret 93 | } 94 | return *o.Authorizer 95 | } 96 | 97 | // GetAuthorizerOk returns a tuple with the Authorizer field value if set, nil otherwise 98 | // and a boolean to check if the value has been set. 99 | func (o *Rule) GetAuthorizerOk() (*RuleHandler, bool) { 100 | if o == nil || IsNil(o.Authorizer) { 101 | return nil, false 102 | } 103 | return o.Authorizer, true 104 | } 105 | 106 | // HasAuthorizer returns a boolean if a field has been set. 107 | func (o *Rule) HasAuthorizer() bool { 108 | if o != nil && !IsNil(o.Authorizer) { 109 | return true 110 | } 111 | 112 | return false 113 | } 114 | 115 | // SetAuthorizer gets a reference to the given RuleHandler and assigns it to the Authorizer field. 116 | func (o *Rule) SetAuthorizer(v RuleHandler) { 117 | o.Authorizer = &v 118 | } 119 | 120 | // GetDescription returns the Description field value if set, zero value otherwise. 121 | func (o *Rule) GetDescription() string { 122 | if o == nil || IsNil(o.Description) { 123 | var ret string 124 | return ret 125 | } 126 | return *o.Description 127 | } 128 | 129 | // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise 130 | // and a boolean to check if the value has been set. 131 | func (o *Rule) GetDescriptionOk() (*string, bool) { 132 | if o == nil || IsNil(o.Description) { 133 | return nil, false 134 | } 135 | return o.Description, true 136 | } 137 | 138 | // HasDescription returns a boolean if a field has been set. 139 | func (o *Rule) HasDescription() bool { 140 | if o != nil && !IsNil(o.Description) { 141 | return true 142 | } 143 | 144 | return false 145 | } 146 | 147 | // SetDescription gets a reference to the given string and assigns it to the Description field. 148 | func (o *Rule) SetDescription(v string) { 149 | o.Description = &v 150 | } 151 | 152 | // GetId returns the Id field value if set, zero value otherwise. 153 | func (o *Rule) GetId() string { 154 | if o == nil || IsNil(o.Id) { 155 | var ret string 156 | return ret 157 | } 158 | return *o.Id 159 | } 160 | 161 | // GetIdOk returns a tuple with the Id field value if set, nil otherwise 162 | // and a boolean to check if the value has been set. 163 | func (o *Rule) GetIdOk() (*string, bool) { 164 | if o == nil || IsNil(o.Id) { 165 | return nil, false 166 | } 167 | return o.Id, true 168 | } 169 | 170 | // HasId returns a boolean if a field has been set. 171 | func (o *Rule) HasId() bool { 172 | if o != nil && !IsNil(o.Id) { 173 | return true 174 | } 175 | 176 | return false 177 | } 178 | 179 | // SetId gets a reference to the given string and assigns it to the Id field. 180 | func (o *Rule) SetId(v string) { 181 | o.Id = &v 182 | } 183 | 184 | // GetMatch returns the Match field value if set, zero value otherwise. 185 | func (o *Rule) GetMatch() RuleMatch { 186 | if o == nil || IsNil(o.Match) { 187 | var ret RuleMatch 188 | return ret 189 | } 190 | return *o.Match 191 | } 192 | 193 | // GetMatchOk returns a tuple with the Match field value if set, nil otherwise 194 | // and a boolean to check if the value has been set. 195 | func (o *Rule) GetMatchOk() (*RuleMatch, bool) { 196 | if o == nil || IsNil(o.Match) { 197 | return nil, false 198 | } 199 | return o.Match, true 200 | } 201 | 202 | // HasMatch returns a boolean if a field has been set. 203 | func (o *Rule) HasMatch() bool { 204 | if o != nil && !IsNil(o.Match) { 205 | return true 206 | } 207 | 208 | return false 209 | } 210 | 211 | // SetMatch gets a reference to the given RuleMatch and assigns it to the Match field. 212 | func (o *Rule) SetMatch(v RuleMatch) { 213 | o.Match = &v 214 | } 215 | 216 | // GetMutators returns the Mutators field value if set, zero value otherwise. 217 | func (o *Rule) GetMutators() []RuleHandler { 218 | if o == nil || IsNil(o.Mutators) { 219 | var ret []RuleHandler 220 | return ret 221 | } 222 | return o.Mutators 223 | } 224 | 225 | // GetMutatorsOk returns a tuple with the Mutators field value if set, nil otherwise 226 | // and a boolean to check if the value has been set. 227 | func (o *Rule) GetMutatorsOk() ([]RuleHandler, bool) { 228 | if o == nil || IsNil(o.Mutators) { 229 | return nil, false 230 | } 231 | return o.Mutators, true 232 | } 233 | 234 | // HasMutators returns a boolean if a field has been set. 235 | func (o *Rule) HasMutators() bool { 236 | if o != nil && !IsNil(o.Mutators) { 237 | return true 238 | } 239 | 240 | return false 241 | } 242 | 243 | // SetMutators gets a reference to the given []RuleHandler and assigns it to the Mutators field. 244 | func (o *Rule) SetMutators(v []RuleHandler) { 245 | o.Mutators = v 246 | } 247 | 248 | // GetUpstream returns the Upstream field value if set, zero value otherwise. 249 | func (o *Rule) GetUpstream() Upstream { 250 | if o == nil || IsNil(o.Upstream) { 251 | var ret Upstream 252 | return ret 253 | } 254 | return *o.Upstream 255 | } 256 | 257 | // GetUpstreamOk returns a tuple with the Upstream field value if set, nil otherwise 258 | // and a boolean to check if the value has been set. 259 | func (o *Rule) GetUpstreamOk() (*Upstream, bool) { 260 | if o == nil || IsNil(o.Upstream) { 261 | return nil, false 262 | } 263 | return o.Upstream, true 264 | } 265 | 266 | // HasUpstream returns a boolean if a field has been set. 267 | func (o *Rule) HasUpstream() bool { 268 | if o != nil && !IsNil(o.Upstream) { 269 | return true 270 | } 271 | 272 | return false 273 | } 274 | 275 | // SetUpstream gets a reference to the given Upstream and assigns it to the Upstream field. 276 | func (o *Rule) SetUpstream(v Upstream) { 277 | o.Upstream = &v 278 | } 279 | 280 | func (o Rule) MarshalJSON() ([]byte, error) { 281 | toSerialize,err := o.ToMap() 282 | if err != nil { 283 | return []byte{}, err 284 | } 285 | return json.Marshal(toSerialize) 286 | } 287 | 288 | func (o Rule) ToMap() (map[string]interface{}, error) { 289 | toSerialize := map[string]interface{}{} 290 | if !IsNil(o.Authenticators) { 291 | toSerialize["authenticators"] = o.Authenticators 292 | } 293 | if !IsNil(o.Authorizer) { 294 | toSerialize["authorizer"] = o.Authorizer 295 | } 296 | if !IsNil(o.Description) { 297 | toSerialize["description"] = o.Description 298 | } 299 | if !IsNil(o.Id) { 300 | toSerialize["id"] = o.Id 301 | } 302 | if !IsNil(o.Match) { 303 | toSerialize["match"] = o.Match 304 | } 305 | if !IsNil(o.Mutators) { 306 | toSerialize["mutators"] = o.Mutators 307 | } 308 | if !IsNil(o.Upstream) { 309 | toSerialize["upstream"] = o.Upstream 310 | } 311 | 312 | for key, value := range o.AdditionalProperties { 313 | toSerialize[key] = value 314 | } 315 | 316 | return toSerialize, nil 317 | } 318 | 319 | func (o *Rule) UnmarshalJSON(data []byte) (err error) { 320 | varRule := _Rule{} 321 | 322 | err = json.Unmarshal(data, &varRule) 323 | 324 | if err != nil { 325 | return err 326 | } 327 | 328 | *o = Rule(varRule) 329 | 330 | additionalProperties := make(map[string]interface{}) 331 | 332 | if err = json.Unmarshal(data, &additionalProperties); err == nil { 333 | delete(additionalProperties, "authenticators") 334 | delete(additionalProperties, "authorizer") 335 | delete(additionalProperties, "description") 336 | delete(additionalProperties, "id") 337 | delete(additionalProperties, "match") 338 | delete(additionalProperties, "mutators") 339 | delete(additionalProperties, "upstream") 340 | o.AdditionalProperties = additionalProperties 341 | } 342 | 343 | return err 344 | } 345 | 346 | type NullableRule struct { 347 | value *Rule 348 | isSet bool 349 | } 350 | 351 | func (v NullableRule) Get() *Rule { 352 | return v.value 353 | } 354 | 355 | func (v *NullableRule) Set(val *Rule) { 356 | v.value = val 357 | v.isSet = true 358 | } 359 | 360 | func (v NullableRule) IsSet() bool { 361 | return v.isSet 362 | } 363 | 364 | func (v *NullableRule) Unset() { 365 | v.value = nil 366 | v.isSet = false 367 | } 368 | 369 | func NewNullableRule(val *Rule) *NullableRule { 370 | return &NullableRule{value: val, isSet: true} 371 | } 372 | 373 | func (v NullableRule) MarshalJSON() ([]byte, error) { 374 | return json.Marshal(v.value) 375 | } 376 | 377 | func (v *NullableRule) UnmarshalJSON(src []byte) error { 378 | v.isSet = true 379 | return json.Unmarshal(src, &v.value) 380 | } 381 | 382 | 383 | -------------------------------------------------------------------------------- /model_rule_handler.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | ) 17 | 18 | // checks if the RuleHandler type satisfies the MappedNullable interface at compile time 19 | var _ MappedNullable = &RuleHandler{} 20 | 21 | // RuleHandler struct for RuleHandler 22 | type RuleHandler struct { 23 | // Config contains the configuration for the handler. Please read the user guide for a complete list of each handler's available settings. 24 | Config map[string]interface{} `json:"config,omitempty"` 25 | // Handler identifies the implementation which will be used to handle this specific request. Please read the user guide for a complete list of available handlers. 26 | Handler *string `json:"handler,omitempty"` 27 | AdditionalProperties map[string]interface{} 28 | } 29 | 30 | type _RuleHandler RuleHandler 31 | 32 | // NewRuleHandler instantiates a new RuleHandler object 33 | // This constructor will assign default values to properties that have it defined, 34 | // and makes sure properties required by API are set, but the set of arguments 35 | // will change when the set of required properties is changed 36 | func NewRuleHandler() *RuleHandler { 37 | this := RuleHandler{} 38 | return &this 39 | } 40 | 41 | // NewRuleHandlerWithDefaults instantiates a new RuleHandler object 42 | // This constructor will only assign default values to properties that have it defined, 43 | // but it doesn't guarantee that properties required by API are set 44 | func NewRuleHandlerWithDefaults() *RuleHandler { 45 | this := RuleHandler{} 46 | return &this 47 | } 48 | 49 | // GetConfig returns the Config field value if set, zero value otherwise. 50 | func (o *RuleHandler) GetConfig() map[string]interface{} { 51 | if o == nil || IsNil(o.Config) { 52 | var ret map[string]interface{} 53 | return ret 54 | } 55 | return o.Config 56 | } 57 | 58 | // GetConfigOk returns a tuple with the Config field value if set, nil otherwise 59 | // and a boolean to check if the value has been set. 60 | func (o *RuleHandler) GetConfigOk() (map[string]interface{}, bool) { 61 | if o == nil || IsNil(o.Config) { 62 | return map[string]interface{}{}, false 63 | } 64 | return o.Config, true 65 | } 66 | 67 | // HasConfig returns a boolean if a field has been set. 68 | func (o *RuleHandler) HasConfig() bool { 69 | if o != nil && !IsNil(o.Config) { 70 | return true 71 | } 72 | 73 | return false 74 | } 75 | 76 | // SetConfig gets a reference to the given map[string]interface{} and assigns it to the Config field. 77 | func (o *RuleHandler) SetConfig(v map[string]interface{}) { 78 | o.Config = v 79 | } 80 | 81 | // GetHandler returns the Handler field value if set, zero value otherwise. 82 | func (o *RuleHandler) GetHandler() string { 83 | if o == nil || IsNil(o.Handler) { 84 | var ret string 85 | return ret 86 | } 87 | return *o.Handler 88 | } 89 | 90 | // GetHandlerOk returns a tuple with the Handler field value if set, nil otherwise 91 | // and a boolean to check if the value has been set. 92 | func (o *RuleHandler) GetHandlerOk() (*string, bool) { 93 | if o == nil || IsNil(o.Handler) { 94 | return nil, false 95 | } 96 | return o.Handler, true 97 | } 98 | 99 | // HasHandler returns a boolean if a field has been set. 100 | func (o *RuleHandler) HasHandler() bool { 101 | if o != nil && !IsNil(o.Handler) { 102 | return true 103 | } 104 | 105 | return false 106 | } 107 | 108 | // SetHandler gets a reference to the given string and assigns it to the Handler field. 109 | func (o *RuleHandler) SetHandler(v string) { 110 | o.Handler = &v 111 | } 112 | 113 | func (o RuleHandler) MarshalJSON() ([]byte, error) { 114 | toSerialize,err := o.ToMap() 115 | if err != nil { 116 | return []byte{}, err 117 | } 118 | return json.Marshal(toSerialize) 119 | } 120 | 121 | func (o RuleHandler) ToMap() (map[string]interface{}, error) { 122 | toSerialize := map[string]interface{}{} 123 | if !IsNil(o.Config) { 124 | toSerialize["config"] = o.Config 125 | } 126 | if !IsNil(o.Handler) { 127 | toSerialize["handler"] = o.Handler 128 | } 129 | 130 | for key, value := range o.AdditionalProperties { 131 | toSerialize[key] = value 132 | } 133 | 134 | return toSerialize, nil 135 | } 136 | 137 | func (o *RuleHandler) UnmarshalJSON(data []byte) (err error) { 138 | varRuleHandler := _RuleHandler{} 139 | 140 | err = json.Unmarshal(data, &varRuleHandler) 141 | 142 | if err != nil { 143 | return err 144 | } 145 | 146 | *o = RuleHandler(varRuleHandler) 147 | 148 | additionalProperties := make(map[string]interface{}) 149 | 150 | if err = json.Unmarshal(data, &additionalProperties); err == nil { 151 | delete(additionalProperties, "config") 152 | delete(additionalProperties, "handler") 153 | o.AdditionalProperties = additionalProperties 154 | } 155 | 156 | return err 157 | } 158 | 159 | type NullableRuleHandler struct { 160 | value *RuleHandler 161 | isSet bool 162 | } 163 | 164 | func (v NullableRuleHandler) Get() *RuleHandler { 165 | return v.value 166 | } 167 | 168 | func (v *NullableRuleHandler) Set(val *RuleHandler) { 169 | v.value = val 170 | v.isSet = true 171 | } 172 | 173 | func (v NullableRuleHandler) IsSet() bool { 174 | return v.isSet 175 | } 176 | 177 | func (v *NullableRuleHandler) Unset() { 178 | v.value = nil 179 | v.isSet = false 180 | } 181 | 182 | func NewNullableRuleHandler(val *RuleHandler) *NullableRuleHandler { 183 | return &NullableRuleHandler{value: val, isSet: true} 184 | } 185 | 186 | func (v NullableRuleHandler) MarshalJSON() ([]byte, error) { 187 | return json.Marshal(v.value) 188 | } 189 | 190 | func (v *NullableRuleHandler) UnmarshalJSON(src []byte) error { 191 | v.isSet = true 192 | return json.Unmarshal(src, &v.value) 193 | } 194 | 195 | 196 | -------------------------------------------------------------------------------- /model_rule_match.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | ) 17 | 18 | // checks if the RuleMatch type satisfies the MappedNullable interface at compile time 19 | var _ MappedNullable = &RuleMatch{} 20 | 21 | // RuleMatch struct for RuleMatch 22 | type RuleMatch struct { 23 | // An array of HTTP methods (e.g. GET, POST, PUT, DELETE, ...). When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the HTTP method of the incoming request with the HTTP methods of each rules. If a match is found, the rule is considered a partial match. If the matchesUrl field is satisfied as well, the rule is considered a full match. 24 | Methods []string `json:"methods,omitempty"` 25 | // This field represents the URL pattern this rule matches. When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the full request URL (e.g. https://mydomain.com/api/resource) without query parameters of the incoming request with this field. If a match is found, the rule is considered a partial match. If the matchesMethods field is satisfied as well, the rule is considered a full match. You can use regular expressions in this field to match more than one url. Regular expressions are encapsulated in brackets < and >. The following example matches all paths of the domain `mydomain.com`: `https://mydomain.com/<.*>`. 26 | Url *string `json:"url,omitempty"` 27 | AdditionalProperties map[string]interface{} 28 | } 29 | 30 | type _RuleMatch RuleMatch 31 | 32 | // NewRuleMatch instantiates a new RuleMatch object 33 | // This constructor will assign default values to properties that have it defined, 34 | // and makes sure properties required by API are set, but the set of arguments 35 | // will change when the set of required properties is changed 36 | func NewRuleMatch() *RuleMatch { 37 | this := RuleMatch{} 38 | return &this 39 | } 40 | 41 | // NewRuleMatchWithDefaults instantiates a new RuleMatch object 42 | // This constructor will only assign default values to properties that have it defined, 43 | // but it doesn't guarantee that properties required by API are set 44 | func NewRuleMatchWithDefaults() *RuleMatch { 45 | this := RuleMatch{} 46 | return &this 47 | } 48 | 49 | // GetMethods returns the Methods field value if set, zero value otherwise. 50 | func (o *RuleMatch) GetMethods() []string { 51 | if o == nil || IsNil(o.Methods) { 52 | var ret []string 53 | return ret 54 | } 55 | return o.Methods 56 | } 57 | 58 | // GetMethodsOk returns a tuple with the Methods field value if set, nil otherwise 59 | // and a boolean to check if the value has been set. 60 | func (o *RuleMatch) GetMethodsOk() ([]string, bool) { 61 | if o == nil || IsNil(o.Methods) { 62 | return nil, false 63 | } 64 | return o.Methods, true 65 | } 66 | 67 | // HasMethods returns a boolean if a field has been set. 68 | func (o *RuleMatch) HasMethods() bool { 69 | if o != nil && !IsNil(o.Methods) { 70 | return true 71 | } 72 | 73 | return false 74 | } 75 | 76 | // SetMethods gets a reference to the given []string and assigns it to the Methods field. 77 | func (o *RuleMatch) SetMethods(v []string) { 78 | o.Methods = v 79 | } 80 | 81 | // GetUrl returns the Url field value if set, zero value otherwise. 82 | func (o *RuleMatch) GetUrl() string { 83 | if o == nil || IsNil(o.Url) { 84 | var ret string 85 | return ret 86 | } 87 | return *o.Url 88 | } 89 | 90 | // GetUrlOk returns a tuple with the Url field value if set, nil otherwise 91 | // and a boolean to check if the value has been set. 92 | func (o *RuleMatch) GetUrlOk() (*string, bool) { 93 | if o == nil || IsNil(o.Url) { 94 | return nil, false 95 | } 96 | return o.Url, true 97 | } 98 | 99 | // HasUrl returns a boolean if a field has been set. 100 | func (o *RuleMatch) HasUrl() bool { 101 | if o != nil && !IsNil(o.Url) { 102 | return true 103 | } 104 | 105 | return false 106 | } 107 | 108 | // SetUrl gets a reference to the given string and assigns it to the Url field. 109 | func (o *RuleMatch) SetUrl(v string) { 110 | o.Url = &v 111 | } 112 | 113 | func (o RuleMatch) MarshalJSON() ([]byte, error) { 114 | toSerialize,err := o.ToMap() 115 | if err != nil { 116 | return []byte{}, err 117 | } 118 | return json.Marshal(toSerialize) 119 | } 120 | 121 | func (o RuleMatch) ToMap() (map[string]interface{}, error) { 122 | toSerialize := map[string]interface{}{} 123 | if !IsNil(o.Methods) { 124 | toSerialize["methods"] = o.Methods 125 | } 126 | if !IsNil(o.Url) { 127 | toSerialize["url"] = o.Url 128 | } 129 | 130 | for key, value := range o.AdditionalProperties { 131 | toSerialize[key] = value 132 | } 133 | 134 | return toSerialize, nil 135 | } 136 | 137 | func (o *RuleMatch) UnmarshalJSON(data []byte) (err error) { 138 | varRuleMatch := _RuleMatch{} 139 | 140 | err = json.Unmarshal(data, &varRuleMatch) 141 | 142 | if err != nil { 143 | return err 144 | } 145 | 146 | *o = RuleMatch(varRuleMatch) 147 | 148 | additionalProperties := make(map[string]interface{}) 149 | 150 | if err = json.Unmarshal(data, &additionalProperties); err == nil { 151 | delete(additionalProperties, "methods") 152 | delete(additionalProperties, "url") 153 | o.AdditionalProperties = additionalProperties 154 | } 155 | 156 | return err 157 | } 158 | 159 | type NullableRuleMatch struct { 160 | value *RuleMatch 161 | isSet bool 162 | } 163 | 164 | func (v NullableRuleMatch) Get() *RuleMatch { 165 | return v.value 166 | } 167 | 168 | func (v *NullableRuleMatch) Set(val *RuleMatch) { 169 | v.value = val 170 | v.isSet = true 171 | } 172 | 173 | func (v NullableRuleMatch) IsSet() bool { 174 | return v.isSet 175 | } 176 | 177 | func (v *NullableRuleMatch) Unset() { 178 | v.value = nil 179 | v.isSet = false 180 | } 181 | 182 | func NewNullableRuleMatch(val *RuleMatch) *NullableRuleMatch { 183 | return &NullableRuleMatch{value: val, isSet: true} 184 | } 185 | 186 | func (v NullableRuleMatch) MarshalJSON() ([]byte, error) { 187 | return json.Marshal(v.value) 188 | } 189 | 190 | func (v *NullableRuleMatch) UnmarshalJSON(src []byte) error { 191 | v.isSet = true 192 | return json.Unmarshal(src, &v.value) 193 | } 194 | 195 | 196 | -------------------------------------------------------------------------------- /model_upstream.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | ) 17 | 18 | // checks if the Upstream type satisfies the MappedNullable interface at compile time 19 | var _ MappedNullable = &Upstream{} 20 | 21 | // Upstream struct for Upstream 22 | type Upstream struct { 23 | // PreserveHost, if false (the default), tells ORY Oathkeeper to set the upstream request's Host header to the hostname of the API's upstream's URL. Setting this flag to true instructs ORY Oathkeeper not to do so. 24 | PreserveHost *bool `json:"preserve_host,omitempty"` 25 | // StripPath if set, replaces the provided path prefix when forwarding the requested URL to the upstream URL. 26 | StripPath *string `json:"strip_path,omitempty"` 27 | // URL is the URL the request will be proxied to. 28 | Url *string `json:"url,omitempty"` 29 | AdditionalProperties map[string]interface{} 30 | } 31 | 32 | type _Upstream Upstream 33 | 34 | // NewUpstream instantiates a new Upstream object 35 | // This constructor will assign default values to properties that have it defined, 36 | // and makes sure properties required by API are set, but the set of arguments 37 | // will change when the set of required properties is changed 38 | func NewUpstream() *Upstream { 39 | this := Upstream{} 40 | return &this 41 | } 42 | 43 | // NewUpstreamWithDefaults instantiates a new Upstream object 44 | // This constructor will only assign default values to properties that have it defined, 45 | // but it doesn't guarantee that properties required by API are set 46 | func NewUpstreamWithDefaults() *Upstream { 47 | this := Upstream{} 48 | return &this 49 | } 50 | 51 | // GetPreserveHost returns the PreserveHost field value if set, zero value otherwise. 52 | func (o *Upstream) GetPreserveHost() bool { 53 | if o == nil || IsNil(o.PreserveHost) { 54 | var ret bool 55 | return ret 56 | } 57 | return *o.PreserveHost 58 | } 59 | 60 | // GetPreserveHostOk returns a tuple with the PreserveHost field value if set, nil otherwise 61 | // and a boolean to check if the value has been set. 62 | func (o *Upstream) GetPreserveHostOk() (*bool, bool) { 63 | if o == nil || IsNil(o.PreserveHost) { 64 | return nil, false 65 | } 66 | return o.PreserveHost, true 67 | } 68 | 69 | // HasPreserveHost returns a boolean if a field has been set. 70 | func (o *Upstream) HasPreserveHost() bool { 71 | if o != nil && !IsNil(o.PreserveHost) { 72 | return true 73 | } 74 | 75 | return false 76 | } 77 | 78 | // SetPreserveHost gets a reference to the given bool and assigns it to the PreserveHost field. 79 | func (o *Upstream) SetPreserveHost(v bool) { 80 | o.PreserveHost = &v 81 | } 82 | 83 | // GetStripPath returns the StripPath field value if set, zero value otherwise. 84 | func (o *Upstream) GetStripPath() string { 85 | if o == nil || IsNil(o.StripPath) { 86 | var ret string 87 | return ret 88 | } 89 | return *o.StripPath 90 | } 91 | 92 | // GetStripPathOk returns a tuple with the StripPath field value if set, nil otherwise 93 | // and a boolean to check if the value has been set. 94 | func (o *Upstream) GetStripPathOk() (*string, bool) { 95 | if o == nil || IsNil(o.StripPath) { 96 | return nil, false 97 | } 98 | return o.StripPath, true 99 | } 100 | 101 | // HasStripPath returns a boolean if a field has been set. 102 | func (o *Upstream) HasStripPath() bool { 103 | if o != nil && !IsNil(o.StripPath) { 104 | return true 105 | } 106 | 107 | return false 108 | } 109 | 110 | // SetStripPath gets a reference to the given string and assigns it to the StripPath field. 111 | func (o *Upstream) SetStripPath(v string) { 112 | o.StripPath = &v 113 | } 114 | 115 | // GetUrl returns the Url field value if set, zero value otherwise. 116 | func (o *Upstream) GetUrl() string { 117 | if o == nil || IsNil(o.Url) { 118 | var ret string 119 | return ret 120 | } 121 | return *o.Url 122 | } 123 | 124 | // GetUrlOk returns a tuple with the Url field value if set, nil otherwise 125 | // and a boolean to check if the value has been set. 126 | func (o *Upstream) GetUrlOk() (*string, bool) { 127 | if o == nil || IsNil(o.Url) { 128 | return nil, false 129 | } 130 | return o.Url, true 131 | } 132 | 133 | // HasUrl returns a boolean if a field has been set. 134 | func (o *Upstream) HasUrl() bool { 135 | if o != nil && !IsNil(o.Url) { 136 | return true 137 | } 138 | 139 | return false 140 | } 141 | 142 | // SetUrl gets a reference to the given string and assigns it to the Url field. 143 | func (o *Upstream) SetUrl(v string) { 144 | o.Url = &v 145 | } 146 | 147 | func (o Upstream) MarshalJSON() ([]byte, error) { 148 | toSerialize,err := o.ToMap() 149 | if err != nil { 150 | return []byte{}, err 151 | } 152 | return json.Marshal(toSerialize) 153 | } 154 | 155 | func (o Upstream) ToMap() (map[string]interface{}, error) { 156 | toSerialize := map[string]interface{}{} 157 | if !IsNil(o.PreserveHost) { 158 | toSerialize["preserve_host"] = o.PreserveHost 159 | } 160 | if !IsNil(o.StripPath) { 161 | toSerialize["strip_path"] = o.StripPath 162 | } 163 | if !IsNil(o.Url) { 164 | toSerialize["url"] = o.Url 165 | } 166 | 167 | for key, value := range o.AdditionalProperties { 168 | toSerialize[key] = value 169 | } 170 | 171 | return toSerialize, nil 172 | } 173 | 174 | func (o *Upstream) UnmarshalJSON(data []byte) (err error) { 175 | varUpstream := _Upstream{} 176 | 177 | err = json.Unmarshal(data, &varUpstream) 178 | 179 | if err != nil { 180 | return err 181 | } 182 | 183 | *o = Upstream(varUpstream) 184 | 185 | additionalProperties := make(map[string]interface{}) 186 | 187 | if err = json.Unmarshal(data, &additionalProperties); err == nil { 188 | delete(additionalProperties, "preserve_host") 189 | delete(additionalProperties, "strip_path") 190 | delete(additionalProperties, "url") 191 | o.AdditionalProperties = additionalProperties 192 | } 193 | 194 | return err 195 | } 196 | 197 | type NullableUpstream struct { 198 | value *Upstream 199 | isSet bool 200 | } 201 | 202 | func (v NullableUpstream) Get() *Upstream { 203 | return v.value 204 | } 205 | 206 | func (v *NullableUpstream) Set(val *Upstream) { 207 | v.value = val 208 | v.isSet = true 209 | } 210 | 211 | func (v NullableUpstream) IsSet() bool { 212 | return v.isSet 213 | } 214 | 215 | func (v *NullableUpstream) Unset() { 216 | v.value = nil 217 | v.isSet = false 218 | } 219 | 220 | func NewNullableUpstream(val *Upstream) *NullableUpstream { 221 | return &NullableUpstream{value: val, isSet: true} 222 | } 223 | 224 | func (v NullableUpstream) MarshalJSON() ([]byte, error) { 225 | return json.Marshal(v.value) 226 | } 227 | 228 | func (v *NullableUpstream) UnmarshalJSON(src []byte) error { 229 | v.isSet = true 230 | return json.Unmarshal(src, &v.value) 231 | } 232 | 233 | 234 | -------------------------------------------------------------------------------- /model_version.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | ) 17 | 18 | // checks if the Version type satisfies the MappedNullable interface at compile time 19 | var _ MappedNullable = &Version{} 20 | 21 | // Version struct for Version 22 | type Version struct { 23 | // Version is the service's version. 24 | Version *string `json:"version,omitempty"` 25 | AdditionalProperties map[string]interface{} 26 | } 27 | 28 | type _Version Version 29 | 30 | // NewVersion instantiates a new Version object 31 | // This constructor will assign default values to properties that have it defined, 32 | // and makes sure properties required by API are set, but the set of arguments 33 | // will change when the set of required properties is changed 34 | func NewVersion() *Version { 35 | this := Version{} 36 | return &this 37 | } 38 | 39 | // NewVersionWithDefaults instantiates a new Version object 40 | // This constructor will only assign default values to properties that have it defined, 41 | // but it doesn't guarantee that properties required by API are set 42 | func NewVersionWithDefaults() *Version { 43 | this := Version{} 44 | return &this 45 | } 46 | 47 | // GetVersion returns the Version field value if set, zero value otherwise. 48 | func (o *Version) GetVersion() string { 49 | if o == nil || IsNil(o.Version) { 50 | var ret string 51 | return ret 52 | } 53 | return *o.Version 54 | } 55 | 56 | // GetVersionOk returns a tuple with the Version field value if set, nil otherwise 57 | // and a boolean to check if the value has been set. 58 | func (o *Version) GetVersionOk() (*string, bool) { 59 | if o == nil || IsNil(o.Version) { 60 | return nil, false 61 | } 62 | return o.Version, true 63 | } 64 | 65 | // HasVersion returns a boolean if a field has been set. 66 | func (o *Version) HasVersion() bool { 67 | if o != nil && !IsNil(o.Version) { 68 | return true 69 | } 70 | 71 | return false 72 | } 73 | 74 | // SetVersion gets a reference to the given string and assigns it to the Version field. 75 | func (o *Version) SetVersion(v string) { 76 | o.Version = &v 77 | } 78 | 79 | func (o Version) MarshalJSON() ([]byte, error) { 80 | toSerialize,err := o.ToMap() 81 | if err != nil { 82 | return []byte{}, err 83 | } 84 | return json.Marshal(toSerialize) 85 | } 86 | 87 | func (o Version) ToMap() (map[string]interface{}, error) { 88 | toSerialize := map[string]interface{}{} 89 | if !IsNil(o.Version) { 90 | toSerialize["version"] = o.Version 91 | } 92 | 93 | for key, value := range o.AdditionalProperties { 94 | toSerialize[key] = value 95 | } 96 | 97 | return toSerialize, nil 98 | } 99 | 100 | func (o *Version) UnmarshalJSON(data []byte) (err error) { 101 | varVersion := _Version{} 102 | 103 | err = json.Unmarshal(data, &varVersion) 104 | 105 | if err != nil { 106 | return err 107 | } 108 | 109 | *o = Version(varVersion) 110 | 111 | additionalProperties := make(map[string]interface{}) 112 | 113 | if err = json.Unmarshal(data, &additionalProperties); err == nil { 114 | delete(additionalProperties, "version") 115 | o.AdditionalProperties = additionalProperties 116 | } 117 | 118 | return err 119 | } 120 | 121 | type NullableVersion struct { 122 | value *Version 123 | isSet bool 124 | } 125 | 126 | func (v NullableVersion) Get() *Version { 127 | return v.value 128 | } 129 | 130 | func (v *NullableVersion) Set(val *Version) { 131 | v.value = val 132 | v.isSet = true 133 | } 134 | 135 | func (v NullableVersion) IsSet() bool { 136 | return v.isSet 137 | } 138 | 139 | func (v *NullableVersion) Unset() { 140 | v.value = nil 141 | v.isSet = false 142 | } 143 | 144 | func NewNullableVersion(val *Version) *NullableVersion { 145 | return &NullableVersion{value: val, isSet: true} 146 | } 147 | 148 | func (v NullableVersion) MarshalJSON() ([]byte, error) { 149 | return json.Marshal(v.value) 150 | } 151 | 152 | func (v *NullableVersion) UnmarshalJSON(src []byte) error { 153 | v.isSet = true 154 | return json.Unmarshal(src, &v.value) 155 | } 156 | 157 | 158 | -------------------------------------------------------------------------------- /response.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "net/http" 16 | ) 17 | 18 | // APIResponse stores the API response returned by the server. 19 | type APIResponse struct { 20 | *http.Response `json:"-"` 21 | Message string `json:"message,omitempty"` 22 | // Operation is the name of the OpenAPI operation. 23 | Operation string `json:"operation,omitempty"` 24 | // RequestURL is the request URL. This value is always available, even if the 25 | // embedded *http.Response is nil. 26 | RequestURL string `json:"url,omitempty"` 27 | // Method is the HTTP method used for the request. This value is always 28 | // available, even if the embedded *http.Response is nil. 29 | Method string `json:"method,omitempty"` 30 | // Payload holds the contents of the response body (which may be nil or empty). 31 | // This is provided here as the raw response.Body() reader will have already 32 | // been drained. 33 | Payload []byte `json:"-"` 34 | } 35 | 36 | // NewAPIResponse returns a new APIResponse object. 37 | func NewAPIResponse(r *http.Response) *APIResponse { 38 | 39 | response := &APIResponse{Response: r} 40 | return response 41 | } 42 | 43 | // NewAPIResponseWithError returns a new APIResponse object with the provided error message. 44 | func NewAPIResponseWithError(errorMessage string) *APIResponse { 45 | 46 | response := &APIResponse{Message: errorMessage} 47 | return response 48 | } 49 | -------------------------------------------------------------------------------- /test/api_api_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | Testing ApiAPIService 5 | 6 | */ 7 | 8 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); 9 | 10 | package client 11 | 12 | import ( 13 | "context" 14 | "github.com/stretchr/testify/assert" 15 | "github.com/stretchr/testify/require" 16 | "testing" 17 | openapiclient "github.com/ory/oathkeeper-client-go" 18 | ) 19 | 20 | func Test_client_ApiAPIService(t *testing.T) { 21 | 22 | configuration := openapiclient.NewConfiguration() 23 | apiClient := openapiclient.NewAPIClient(configuration) 24 | 25 | t.Run("Test ApiAPIService Decisions", func(t *testing.T) { 26 | 27 | t.Skip("skip test") // remove to run test 28 | 29 | httpRes, err := apiClient.ApiAPI.Decisions(context.Background()).Execute() 30 | 31 | require.Nil(t, err) 32 | assert.Equal(t, 200, httpRes.StatusCode) 33 | 34 | }) 35 | 36 | t.Run("Test ApiAPIService GetRule", func(t *testing.T) { 37 | 38 | t.Skip("skip test") // remove to run test 39 | 40 | var id string 41 | 42 | resp, httpRes, err := apiClient.ApiAPI.GetRule(context.Background(), id).Execute() 43 | 44 | require.Nil(t, err) 45 | require.NotNil(t, resp) 46 | assert.Equal(t, 200, httpRes.StatusCode) 47 | 48 | }) 49 | 50 | t.Run("Test ApiAPIService GetWellKnownJSONWebKeys", func(t *testing.T) { 51 | 52 | t.Skip("skip test") // remove to run test 53 | 54 | resp, httpRes, err := apiClient.ApiAPI.GetWellKnownJSONWebKeys(context.Background()).Execute() 55 | 56 | require.Nil(t, err) 57 | require.NotNil(t, resp) 58 | assert.Equal(t, 200, httpRes.StatusCode) 59 | 60 | }) 61 | 62 | t.Run("Test ApiAPIService ListRules", func(t *testing.T) { 63 | 64 | t.Skip("skip test") // remove to run test 65 | 66 | resp, httpRes, err := apiClient.ApiAPI.ListRules(context.Background()).Execute() 67 | 68 | require.Nil(t, err) 69 | require.NotNil(t, resp) 70 | assert.Equal(t, 200, httpRes.StatusCode) 71 | 72 | }) 73 | 74 | } 75 | -------------------------------------------------------------------------------- /test/api_health_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | Testing HealthAPIService 5 | 6 | */ 7 | 8 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); 9 | 10 | package client 11 | 12 | import ( 13 | "context" 14 | "github.com/stretchr/testify/assert" 15 | "github.com/stretchr/testify/require" 16 | "testing" 17 | openapiclient "github.com/ory/oathkeeper-client-go" 18 | ) 19 | 20 | func Test_client_HealthAPIService(t *testing.T) { 21 | 22 | configuration := openapiclient.NewConfiguration() 23 | apiClient := openapiclient.NewAPIClient(configuration) 24 | 25 | t.Run("Test HealthAPIService IsInstanceAlive", func(t *testing.T) { 26 | 27 | t.Skip("skip test") // remove to run test 28 | 29 | resp, httpRes, err := apiClient.HealthAPI.IsInstanceAlive(context.Background()).Execute() 30 | 31 | require.Nil(t, err) 32 | require.NotNil(t, resp) 33 | assert.Equal(t, 200, httpRes.StatusCode) 34 | 35 | }) 36 | 37 | t.Run("Test HealthAPIService IsInstanceReady", func(t *testing.T) { 38 | 39 | t.Skip("skip test") // remove to run test 40 | 41 | resp, httpRes, err := apiClient.HealthAPI.IsInstanceReady(context.Background()).Execute() 42 | 43 | require.Nil(t, err) 44 | require.NotNil(t, resp) 45 | assert.Equal(t, 200, httpRes.StatusCode) 46 | 47 | }) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /test/api_version_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | Testing VersionAPIService 5 | 6 | */ 7 | 8 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); 9 | 10 | package client 11 | 12 | import ( 13 | "context" 14 | "github.com/stretchr/testify/assert" 15 | "github.com/stretchr/testify/require" 16 | "testing" 17 | openapiclient "github.com/ory/oathkeeper-client-go" 18 | ) 19 | 20 | func Test_client_VersionAPIService(t *testing.T) { 21 | 22 | configuration := openapiclient.NewConfiguration() 23 | apiClient := openapiclient.NewAPIClient(configuration) 24 | 25 | t.Run("Test VersionAPIService GetVersion", func(t *testing.T) { 26 | 27 | t.Skip("skip test") // remove to run test 28 | 29 | resp, httpRes, err := apiClient.VersionAPI.GetVersion(context.Background()).Execute() 30 | 31 | require.Nil(t, err) 32 | require.NotNil(t, resp) 33 | assert.Equal(t, 200, httpRes.StatusCode) 34 | 35 | }) 36 | 37 | } 38 | -------------------------------------------------------------------------------- /utils.go: -------------------------------------------------------------------------------- 1 | /* 2 | ORY Oathkeeper 3 | 4 | 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. 5 | 6 | API version: v0.40.8 7 | Contact: hi@ory.am 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 | 12 | package client 13 | 14 | import ( 15 | "encoding/json" 16 | "reflect" 17 | "time" 18 | ) 19 | 20 | // PtrBool is a helper routine that returns a pointer to given boolean value. 21 | func PtrBool(v bool) *bool { return &v } 22 | 23 | // PtrInt is a helper routine that returns a pointer to given integer value. 24 | func PtrInt(v int) *int { return &v } 25 | 26 | // PtrInt32 is a helper routine that returns a pointer to given integer value. 27 | func PtrInt32(v int32) *int32 { return &v } 28 | 29 | // PtrInt64 is a helper routine that returns a pointer to given integer value. 30 | func PtrInt64(v int64) *int64 { return &v } 31 | 32 | // PtrFloat32 is a helper routine that returns a pointer to given float value. 33 | func PtrFloat32(v float32) *float32 { return &v } 34 | 35 | // PtrFloat64 is a helper routine that returns a pointer to given float value. 36 | func PtrFloat64(v float64) *float64 { return &v } 37 | 38 | // PtrString is a helper routine that returns a pointer to given string value. 39 | func PtrString(v string) *string { return &v } 40 | 41 | // PtrTime is helper routine that returns a pointer to given Time value. 42 | func PtrTime(v time.Time) *time.Time { return &v } 43 | 44 | type NullableBool struct { 45 | value *bool 46 | isSet bool 47 | } 48 | 49 | func (v NullableBool) Get() *bool { 50 | return v.value 51 | } 52 | 53 | func (v *NullableBool) Set(val *bool) { 54 | v.value = val 55 | v.isSet = true 56 | } 57 | 58 | func (v NullableBool) IsSet() bool { 59 | return v.isSet 60 | } 61 | 62 | func (v *NullableBool) Unset() { 63 | v.value = nil 64 | v.isSet = false 65 | } 66 | 67 | func NewNullableBool(val *bool) *NullableBool { 68 | return &NullableBool{value: val, isSet: true} 69 | } 70 | 71 | func (v NullableBool) MarshalJSON() ([]byte, error) { 72 | return json.Marshal(v.value) 73 | } 74 | 75 | func (v *NullableBool) UnmarshalJSON(src []byte) error { 76 | v.isSet = true 77 | return json.Unmarshal(src, &v.value) 78 | } 79 | 80 | type NullableInt struct { 81 | value *int 82 | isSet bool 83 | } 84 | 85 | func (v NullableInt) Get() *int { 86 | return v.value 87 | } 88 | 89 | func (v *NullableInt) Set(val *int) { 90 | v.value = val 91 | v.isSet = true 92 | } 93 | 94 | func (v NullableInt) IsSet() bool { 95 | return v.isSet 96 | } 97 | 98 | func (v *NullableInt) Unset() { 99 | v.value = nil 100 | v.isSet = false 101 | } 102 | 103 | func NewNullableInt(val *int) *NullableInt { 104 | return &NullableInt{value: val, isSet: true} 105 | } 106 | 107 | func (v NullableInt) MarshalJSON() ([]byte, error) { 108 | return json.Marshal(v.value) 109 | } 110 | 111 | func (v *NullableInt) UnmarshalJSON(src []byte) error { 112 | v.isSet = true 113 | return json.Unmarshal(src, &v.value) 114 | } 115 | 116 | type NullableInt32 struct { 117 | value *int32 118 | isSet bool 119 | } 120 | 121 | func (v NullableInt32) Get() *int32 { 122 | return v.value 123 | } 124 | 125 | func (v *NullableInt32) Set(val *int32) { 126 | v.value = val 127 | v.isSet = true 128 | } 129 | 130 | func (v NullableInt32) IsSet() bool { 131 | return v.isSet 132 | } 133 | 134 | func (v *NullableInt32) Unset() { 135 | v.value = nil 136 | v.isSet = false 137 | } 138 | 139 | func NewNullableInt32(val *int32) *NullableInt32 { 140 | return &NullableInt32{value: val, isSet: true} 141 | } 142 | 143 | func (v NullableInt32) MarshalJSON() ([]byte, error) { 144 | return json.Marshal(v.value) 145 | } 146 | 147 | func (v *NullableInt32) UnmarshalJSON(src []byte) error { 148 | v.isSet = true 149 | return json.Unmarshal(src, &v.value) 150 | } 151 | 152 | type NullableInt64 struct { 153 | value *int64 154 | isSet bool 155 | } 156 | 157 | func (v NullableInt64) Get() *int64 { 158 | return v.value 159 | } 160 | 161 | func (v *NullableInt64) Set(val *int64) { 162 | v.value = val 163 | v.isSet = true 164 | } 165 | 166 | func (v NullableInt64) IsSet() bool { 167 | return v.isSet 168 | } 169 | 170 | func (v *NullableInt64) Unset() { 171 | v.value = nil 172 | v.isSet = false 173 | } 174 | 175 | func NewNullableInt64(val *int64) *NullableInt64 { 176 | return &NullableInt64{value: val, isSet: true} 177 | } 178 | 179 | func (v NullableInt64) MarshalJSON() ([]byte, error) { 180 | return json.Marshal(v.value) 181 | } 182 | 183 | func (v *NullableInt64) UnmarshalJSON(src []byte) error { 184 | v.isSet = true 185 | return json.Unmarshal(src, &v.value) 186 | } 187 | 188 | type NullableFloat32 struct { 189 | value *float32 190 | isSet bool 191 | } 192 | 193 | func (v NullableFloat32) Get() *float32 { 194 | return v.value 195 | } 196 | 197 | func (v *NullableFloat32) Set(val *float32) { 198 | v.value = val 199 | v.isSet = true 200 | } 201 | 202 | func (v NullableFloat32) IsSet() bool { 203 | return v.isSet 204 | } 205 | 206 | func (v *NullableFloat32) Unset() { 207 | v.value = nil 208 | v.isSet = false 209 | } 210 | 211 | func NewNullableFloat32(val *float32) *NullableFloat32 { 212 | return &NullableFloat32{value: val, isSet: true} 213 | } 214 | 215 | func (v NullableFloat32) MarshalJSON() ([]byte, error) { 216 | return json.Marshal(v.value) 217 | } 218 | 219 | func (v *NullableFloat32) UnmarshalJSON(src []byte) error { 220 | v.isSet = true 221 | return json.Unmarshal(src, &v.value) 222 | } 223 | 224 | type NullableFloat64 struct { 225 | value *float64 226 | isSet bool 227 | } 228 | 229 | func (v NullableFloat64) Get() *float64 { 230 | return v.value 231 | } 232 | 233 | func (v *NullableFloat64) Set(val *float64) { 234 | v.value = val 235 | v.isSet = true 236 | } 237 | 238 | func (v NullableFloat64) IsSet() bool { 239 | return v.isSet 240 | } 241 | 242 | func (v *NullableFloat64) Unset() { 243 | v.value = nil 244 | v.isSet = false 245 | } 246 | 247 | func NewNullableFloat64(val *float64) *NullableFloat64 { 248 | return &NullableFloat64{value: val, isSet: true} 249 | } 250 | 251 | func (v NullableFloat64) MarshalJSON() ([]byte, error) { 252 | return json.Marshal(v.value) 253 | } 254 | 255 | func (v *NullableFloat64) UnmarshalJSON(src []byte) error { 256 | v.isSet = true 257 | return json.Unmarshal(src, &v.value) 258 | } 259 | 260 | type NullableString struct { 261 | value *string 262 | isSet bool 263 | } 264 | 265 | func (v NullableString) Get() *string { 266 | return v.value 267 | } 268 | 269 | func (v *NullableString) Set(val *string) { 270 | v.value = val 271 | v.isSet = true 272 | } 273 | 274 | func (v NullableString) IsSet() bool { 275 | return v.isSet 276 | } 277 | 278 | func (v *NullableString) Unset() { 279 | v.value = nil 280 | v.isSet = false 281 | } 282 | 283 | func NewNullableString(val *string) *NullableString { 284 | return &NullableString{value: val, isSet: true} 285 | } 286 | 287 | func (v NullableString) MarshalJSON() ([]byte, error) { 288 | return json.Marshal(v.value) 289 | } 290 | 291 | func (v *NullableString) UnmarshalJSON(src []byte) error { 292 | v.isSet = true 293 | return json.Unmarshal(src, &v.value) 294 | } 295 | 296 | type NullableTime struct { 297 | value *time.Time 298 | isSet bool 299 | } 300 | 301 | func (v NullableTime) Get() *time.Time { 302 | return v.value 303 | } 304 | 305 | func (v *NullableTime) Set(val *time.Time) { 306 | v.value = val 307 | v.isSet = true 308 | } 309 | 310 | func (v NullableTime) IsSet() bool { 311 | return v.isSet 312 | } 313 | 314 | func (v *NullableTime) Unset() { 315 | v.value = nil 316 | v.isSet = false 317 | } 318 | 319 | func NewNullableTime(val *time.Time) *NullableTime { 320 | return &NullableTime{value: val, isSet: true} 321 | } 322 | 323 | func (v NullableTime) MarshalJSON() ([]byte, error) { 324 | return json.Marshal(v.value) 325 | } 326 | 327 | func (v *NullableTime) UnmarshalJSON(src []byte) error { 328 | v.isSet = true 329 | return json.Unmarshal(src, &v.value) 330 | } 331 | 332 | // IsNil checks if an input is nil 333 | func IsNil(i interface{}) bool { 334 | if i == nil { 335 | return true 336 | } 337 | switch reflect.TypeOf(i).Kind() { 338 | case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: 339 | return reflect.ValueOf(i).IsNil() 340 | case reflect.Array: 341 | return reflect.ValueOf(i).IsZero() 342 | } 343 | return false 344 | } 345 | 346 | type MappedNullable interface { 347 | ToMap() (map[string]interface{}, error) 348 | } 349 | --------------------------------------------------------------------------------