Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/master' into feat_dev_grants_2x
Browse files Browse the repository at this point in the history
  • Loading branch information
supercairos committed Sep 8, 2022
2 parents b3e10dd + 2eea63b commit e216bb5
Show file tree
Hide file tree
Showing 12 changed files with 919 additions and 136 deletions.
39 changes: 0 additions & 39 deletions .circleci/config.yml

This file was deleted.

21 changes: 7 additions & 14 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,18 @@ body:
- attributes:
label: "Preflight checklist"
options:
- label:
"I could not find a solution in the existing issues, docs, nor
- label: "I could not find a solution in the existing issues, docs, nor
discussions."
required: true
- label:
"I agree to follow this project's [Code of
- label: "I agree to follow this project's [Code of
Conduct](https://github.com/ory/fosite/blob/master/CODE_OF_CONDUCT.md)."
required: true
- label:
"I have read and am following this repository's [Contribution
- label: "I have read and am following this repository's [Contribution
Guidelines](https://github.com/ory/fosite/blob/master/CONTRIBUTING.md)."
required: true
- label:
"This issue affects my [Ory Cloud](https://www.ory.sh/) project."
- label:
"I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label:
"I am signed up to the [Ory Security Patch
- label: "This issue affects my [Ory Cloud](https://www.ory.sh/) project."
- label: "I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label: "I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53)."
id: checklist
type: checkboxes
Expand All @@ -53,8 +47,7 @@ body:
validations:
required: true
- attributes:
description:
"Please copy and paste any relevant log output. This will be
description: "Please copy and paste any relevant log output. This will be
automatically formatted into code, so no need for backticks. Please
redact any sensitive information"
label: "Relevant log output"
Expand Down
21 changes: 7 additions & 14 deletions .github/ISSUE_TEMPLATE/DESIGN-DOC.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
description:
"A design document is needed for non-trivial changes to the code base."
description: "A design document is needed for non-trivial changes to the code base."
labels:
- rfc
name: "Design Document"
Expand All @@ -20,24 +19,18 @@ body:
- attributes:
label: "Preflight checklist"
options:
- label:
"I could not find a solution in the existing issues, docs, nor
- label: "I could not find a solution in the existing issues, docs, nor
discussions."
required: true
- label:
"I agree to follow this project's [Code of
- label: "I agree to follow this project's [Code of
Conduct](https://github.com/ory/fosite/blob/master/CODE_OF_CONDUCT.md)."
required: true
- label:
"I have read and am following this repository's [Contribution
- label: "I have read and am following this repository's [Contribution
Guidelines](https://github.com/ory/fosite/blob/master/CONTRIBUTING.md)."
required: true
- label:
"This issue affects my [Ory Cloud](https://www.ory.sh/) project."
- label:
"I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label:
"I am signed up to the [Ory Security Patch
- label: "This issue affects my [Ory Cloud](https://www.ory.sh/) project."
- label: "I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label: "I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53)."
id: checklist
type: checkboxes
Expand Down
27 changes: 9 additions & 18 deletions .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
description:
"Suggest an idea for this project without a plan for implementation"
description: "Suggest an idea for this project without a plan for implementation"
labels:
- feat
name: "Feature Request"
Expand All @@ -13,30 +12,23 @@ body:
- attributes:
label: "Preflight checklist"
options:
- label:
"I could not find a solution in the existing issues, docs, nor
- label: "I could not find a solution in the existing issues, docs, nor
discussions."
required: true
- label:
"I agree to follow this project's [Code of
- label: "I agree to follow this project's [Code of
Conduct](https://github.com/ory/fosite/blob/master/CODE_OF_CONDUCT.md)."
required: true
- label:
"I have read and am following this repository's [Contribution
- label: "I have read and am following this repository's [Contribution
Guidelines](https://github.com/ory/fosite/blob/master/CONTRIBUTING.md)."
required: true
- label:
"This issue affects my [Ory Cloud](https://www.ory.sh/) project."
- label:
"I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label:
"I am signed up to the [Ory Security Patch
- label: "This issue affects my [Ory Cloud](https://www.ory.sh/) project."
- label: "I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label: "I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53)."
id: checklist
type: checkboxes
- attributes:
description:
"Is your feature request related to a problem? Please describe."
description: "Is your feature request related to a problem? Please describe."
label: "Describe your problem"
placeholder:
"A clear and concise description of what the problem is. Ex. I'm always
Expand Down Expand Up @@ -70,8 +62,7 @@ body:
validations:
required: true
- attributes:
description:
"Add any other context or screenshots about the feature request here."
description: "Add any other context or screenshots about the feature request here."
label: Additional Context
id: additional
type: textarea
6 changes: 2 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ blank_issues_enabled: false
contact_links:
- name: Ory Fosite Forum
url: https://github.com/orgs/ory/discussions
about:
Please ask and answer questions here, show your implementations and
about: Please ask and answer questions here, show your implementations and
discuss ideas.
- name: Ory Chat
url: https://www.ory.sh/chat
about:
Hang out with other Ory community members to ask and answer questions.
about: Hang out with other Ory community members to ask and answer questions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ them, don't hesitate to ask. We're here to help! This is simply a reminder of wh
- [ ] I have read the [contributing guidelines](../blob/master/CONTRIBUTING.md) and signed the CLA.
- [ ] I have referenced an issue containing the design document if my change introduces a new feature.
- [ ] I have read the [security policy](../security/policy).
- [ ] I confirm that this pull request does not address a security vulnerability.
If this pull request addresses a security vulnerability,
- [ ] I confirm that this pull request does not address a security vulnerability.
If this pull request addresses a security vulnerability,
I confirm that I got green light (please contact [security@ory.sh](mailto:security@ory.sh)) from the maintainers to push the changes.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added necessary documentation within the code base (if appropriate).
Expand Down
4 changes: 1 addition & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"extends": [
"config:base"
],
"extends": ["config:base"],
"prHourlyLimit": 1,
"prConcurrentLimit": 2
}
4 changes: 2 additions & 2 deletions .github/workflows/oidc-conformity-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "OpenID Connect Conformity Tests on Master Branch)"
on:
push:
branches:
- master
- master

jobs:
oidc-conformity:
Expand All @@ -17,7 +17,7 @@ jobs:
ref: v2.x
- uses: actions/setup-go@v2
with:
go-version: '^1.16.0'
go-version: "^1.16.0"
- name: Update fosite
run: |
go mod edit -replace github.com/ory/fosite=github.com/ory/fosite@${{ github.sha }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/oidc-conformity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "OpenID Connect Conformity Tests"
on:
pull_request:
branches:
- master
- master

jobs:
oidc-conformity:
Expand All @@ -17,7 +17,7 @@ jobs:
ref: v2.x
- uses: actions/setup-go@v2
with:
go-version: '^1.15.0'
go-version: "^1.15.0"
- name: Update fosite
run: |
go mod edit -replace github.com/ory/fosite=github.com/${{ github.event.pull_request.head.repo.full_name }}@${{ github.event.pull_request.head.sha }}
Expand Down
22 changes: 12 additions & 10 deletions docs/how-tos/client_credentials_grant.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Client Credentials Grant

The following example configures a *fosite* *OAuth2 Provider* for issuing *JWT* *access tokens* using the *Client Credentials Grant*. This grant allows a client to request access tokens using only its client credentials at the *Token Endpoint*(see [rfc6749 Section 4.4](https://tools.ietf.org/html/rfc6749#section-4.4). For this aim, this *how-to* configures:
The following example configures a _fosite_ _OAuth2 Provider_ for issuing _JWT_ _access tokens_ using the _Client Credentials Grant_. This grant allows a client to request access tokens using only its client credentials at the _Token Endpoint_(see [rfc6749 Section 4.4](https://tools.ietf.org/html/rfc6749#section-4.4). For this aim, this _how-to_ configures:

* RSA *JWT Strategy* to sign JWT *access tokens*
* *Token Endpoint* http handler
* A `fosite.OAuth2Provider` that provides the following services:
* Create and validate [*OAuth2 Access Token Requests*](https://tools.ietf.org/html/rfc6749#section-4.1.3) with *Client Credentials Grant*
* Create an [*Access Token Response*](https://tools.ietf.org/html/rfc6749#section-4.1.4) and
* Sends a [successful](https://tools.ietf.org/html/rfc6749#section-5.1) or [error](https://tools.ietf.org/html/rfc6749#section-5.2) HTTP response to client
- RSA _JWT Strategy_ to sign JWT _access tokens_
- _Token Endpoint_ http handler
- A `fosite.OAuth2Provider` that provides the following services:
- Create and validate [_OAuth2 Access Token Requests_](https://tools.ietf.org/html/rfc6749#section-4.1.3) with _Client Credentials Grant_
- Create an [_Access Token Response_](https://tools.ietf.org/html/rfc6749#section-4.1.4) and
- Sends a [successful](https://tools.ietf.org/html/rfc6749#section-5.1) or [error](https://tools.ietf.org/html/rfc6749#section-5.2) HTTP response to client

## Code Example

`token_handler.go`
```golang

````golang
package main

import (
Expand Down Expand Up @@ -68,9 +69,10 @@ func (t *tokenHandler) TokenHandler(w http.ResponseWriter, r *http.Request) {
t.oauth.WriteAccessResponse(w, ar, response)
}

```
````

`main.go`

```go
package main

Expand Down Expand Up @@ -151,4 +153,4 @@ $curl http://localhost:8080/token -d grant_type=client_credentials -d client_id=
"scope": "",
"token_type": "bearer"
}
```
```
Loading

0 comments on commit e216bb5

Please sign in to comment.