Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for audience usage #484

Merged
merged 3 commits into from
Apr 26, 2020
Merged

Conversation

CorreyL
Copy link
Contributor

@CorreyL CorreyL commented Apr 24, 2020

Hello pyjwt maintainers,

I've recently been using the pyjwt codebase to decode JWT tokens originating from Keycloak servers, where the JWT aud claim is an array by default, and I'm dealing with a python API server that supports multiple audiences.

The edits I've made in this PR hope to improve the documentation for users who are not as familiar with the specific details surrounding the audience claim, like I was until I started digging into using pyjwt more.

ddc1dc1

Makes an explicit code block example for the aud claim being an array. It was mentioned in the text, but I think making a code block demonstrating it helps make it more clear.

46d1940

Adds an example of the audience param for jwt.decode supporting an iterable argument, as implemented in #306.

Note that I'm not stuck to the placement of this example, but I was unsuccessful at locating documentation specific to the jwt.decode implementation

f01df86

Is a simple .rst formatting change where the linter I was using was throwing a warning:

image

The previous code example only showed the `aud` claim as a single
case-sensitive string, despite the documentation mentioning that the
`aud` claim can be an array of case-sensitive strings

Add a code block demonstrating the `aud` claim being an array of
case-sensitive strings to make it more clear to the user that it is a
permitted use of the `aud` claim
Demonstrate to users reading the documentation that the `audience`
parameter is not restricted to the `string` type, but can also accept an
iterable, as implemented in PR#306

jpadilla#306
Short title underlines throw warnings in reStructuredText linters
@coveralls
Copy link

coveralls commented Apr 24, 2020

Pull Request Test Coverage Report for Build 196

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 0.0%

Totals Coverage Status
Change from base Build 178: 0%
Covered Lines: 0
Relevant Lines: 0

💛 - Coveralls

@jpadilla
Copy link
Owner

this is great, thanks!

@jpadilla jpadilla added the docs label Apr 26, 2020
@jpadilla jpadilla merged commit 2b56409 into jpadilla:master Apr 26, 2020
jpadilla pushed a commit that referenced this pull request Jun 19, 2020
* Add code example for `aud` being an array

The previous code example only showed the `aud` claim as a single
case-sensitive string, despite the documentation mentioning that the
`aud` claim can be an array of case-sensitive strings

Add a code block demonstrating the `aud` claim being an array of
case-sensitive strings to make it more clear to the user that it is a
permitted use of the `aud` claim

* Add example of the `audience` param as an iterable

Demonstrate to users reading the documentation that the `audience`
parameter is not restricted to the `string` type, but can also accept an
iterable, as implemented in PR#306

#306

* Fix short title underlines

Short title underlines throw warnings in reStructuredText linters
@jpadilla jpadilla added this to the v2.0.0 milestone Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants