Skip to content

Commit

Permalink
restore custom text in readme, general cleanup for i-d-template autom…
Browse files Browse the repository at this point in the history
…ations
  • Loading branch information
aaronpk committed Oct 13, 2022
1 parent d627fca commit cb0cb2d
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 24 deletions.
20 changes: 0 additions & 20 deletions LICENSE

This file was deleted.

23 changes: 23 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
# License

Copyright (c) 2012-2022 IETF

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


See the
[guidelines for contributions](https://github.com/oauth-wg/oauth-selective-disclosure-jwt/blob/master/CONTRIBUTING.md).

52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,51 @@ Contributions can be made by creating pull requests.
The GitHub interface supports creating pull requests using the Edit (✏) button.


## Running SD-JWT PoC

All examples in the document are created from [actual running code](sd_jwt/bin/sd_jwt). To run this code, install sd_jwt:
```
pip3 install .
```

You can read the inline documentation:
````
sd_jwt -h
````

You can then run the code (from the root of this repository):
```
sd_jwt sd_jwt/examples/simple.yml
sd_jwt sd_jwt/examples/simple_structured.yml
sd_jwt sd_jwt/examples/complex.yml
```

You can create your custom setting file creating a folder with a copy of
[sd_jwt/demo_settings.py](sd_jwt/demo_settings.py) renamed to `settings.py`
and a `__init__.py` in it. Then run `sd_jwt` specifying the custom settings path:

````
sd_jwt sd_jwt/examples/simple.yml --settings-path ./custom_settings/
````

## Updating Examples

To update the examples in [draft-ietf-oauth-selective-disclosure-jwt.md](draft-ietf-oauth-selective-disclosure-jwt.md), use the provided script:
```
./update-all-examples.sh
```

It calls the demos with the switch `--replace-examples-in` to replace the example code in
[draft-ietf-oauth-selective-disclosure-jwt.md](draft-ietf-oauth-selective-disclosure-jwt.md) and `--no-randomness` to ensure that the examples are always
generated in the same way (this minimizes the changes that need to be tracked).

The code creates a backup before modifying [draft-ietf-oauth-selective-disclosure-jwt.md](draft-ietf-oauth-selective-disclosure-jwt.md) in [draft-ietf-oauth-selective-disclosure-jwt.bak](draft-ietf-oauth-selective-disclosure-jwt.bak).



## Command Line Usage

Formatted text and HTML versions of the draft can be built using `make`.
To build the HTML version locally, instead of using the GitHub Action, you can use `make`.

```sh
$ make
Expand All @@ -28,3 +70,11 @@ $ make
Command line usage requires that you have the necessary software installed. See
[the instructions](https://github.com/martinthomson/i-d-template/blob/main/doc/SETUP.md).


# Implementations

* Python: [Reference/Demo Implementation](https://github.com/oauthstuff/draft-selective-disclosure-jwt)
* Kotlin: [SD-JWT-Kotlin](https://github.com/IDunion/SD-JWT-Kotlin)
* Rust: [sd_jwt](https://github.com/kushaldas/sd_jwt)
* TypeScript: [sd-jwt](https://github.com/christianpaquin/sd-jwt)

2 changes: 1 addition & 1 deletion sd_jwt/bin/sd_jwt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ parser.add_argument(
required=False,
type=pathlib.Path,
help=(
"path/to/main.md - Do not output examples, but replace all the examples in the specs"
"path/to/draft-ietf-oauth-selective-disclosure-jwt.md - Do not output examples, but replace all the examples in the specs"
),
)
parser.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion sd_jwt/replace_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def replace_all_in_file(
ignore_missing_placeholders: bool = False,
):
"""
Replaces all the placeholders in the main.md file
Replaces all the placeholders in the draft-ietf-oauth-selective-disclosure-jwt.md file
"""

file_contents = file.read_text()
Expand Down
2 changes: 1 addition & 1 deletion update-all-examples.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
SDJWT_ARGS="--replace-examples-in main.md --nonce XZOUco1u_gEPknxS78sWWg --iat 1516239022 --exp 1516247022 --no-randomness"
SDJWT_ARGS="--replace-examples-in draft-ietf-oauth-selective-disclosure-jwt.md --nonce XZOUco1u_gEPknxS78sWWg --iat 1516239022 --exp 1516247022 --no-randomness"

for file in sd_jwt/examples/*.yml
do
Expand Down

0 comments on commit cb0cb2d

Please sign in to comment.