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

Add example token for actuation and provision #577

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions jwt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Databroker Example Tokens

This directory contains example tokens for demo and test purposes for KUKSA.val Databroker.
For more information on token format see [documentation](../doc/KUKSA.val_data_broker/authorization.md).

## Available tokens


* `actuate-provide-all.token` - gives access to set target value and actual value for all signals
* `provide-all.token` - gives access to set actual value for all signals, but not target value
* `read-all.token` - gives access to read actual and current value for all signals
* `provide-vehicle-speed.token` - gives access to write and read actual value for Vehicle.Speed. Does not give access to other signals
* `read-vehicle-speed.token` - gives access to read actual value for Vehicle.Speed. Does not give access to other signals


## Create new tokens

Tokens can be generated as described in [documentation](../kuksa_certificates/README.md).
Note that token generation must take place from the directory containing `createToken.py`

An example is shown below:

```
~/kuksa.val/kuksa_certificates/jwt$ python -m createToken ../../jwt/actuate-provide-all.json
Reading private key from jwt.key
Reading JWT payload from ../../jwt/actuate-provide-all.json
Writing signed access token to ../../jwt/actuate-provide-all.token
```
10 changes: 10 additions & 0 deletions jwt/actuate-provide-all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"sub": "local dev",
"iss": "createToken.py",
"aud": [
"kuksa.val"
],
"iat": 1516239022,
"exp": 1767225599,
"scope": "actuate provide"
}
1 change: 1 addition & 0 deletions jwt/actuate-provide-all.token
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJsb2NhbCBkZXYiLCJpc3MiOiJjcmVhdGVUb2tlbi5weSIsImF1ZCI6WyJrdWtzYS52YWwiXSwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE3NjcyMjU1OTksInNjb3BlIjoiYWN0dWF0ZSBwcm92aWRlIn0.x-bUZwDCC663wGYrWCYjQZwQWhN1CMuKgxuIN5dUF_izwMutiqF6Xc-tnXgZa93BbT3I74WOMk4awKHBUSTWekGs3-qF6gajorbat6n5180TOqvNu4CXuIPZN5zpngf4id3smMkKOT699tPnSEbmlkj4vk-mIjeOAU-FcYA-VbkKBTsjvfFgKa2OdB5h9uZARBg5Rx7uBN3JsH1I6j9zoLid184Ewa6bhU2qniFt5iPsGJniNsKsRrrndN1KzthO13My44s56yvwSHIOrgDGbXdja_eLuOVOq9pHCjCtorPScgEuUUE4aldIuML-_j397taNP9Y3VZYVvofEK7AuiePTbzwxrZ1RAjK74h1-4ued3A2gUTjr5BsRlc9b7eLZzxLJkrqdfGAzBh_rtrB7p32TbvpjeFP30NW6bB9JS43XACUUm_S_RcyI7BLuUdnFyQDQr6l6sRz9XayYXceilHdCxbAVN0HVnBeui5Bb0mUZYIRZeY8k6zcssmokANTD8ZviDMpKlOU3t5AlXJ0nLkgyMhV9IUTwPUv6F8BTPc-CquJCUNbTyo4ywTSoODWbm3PmQ3Y46gWF06xqnB4wehLscBdVk3iAihQp3tckGhMnx5PI_Oy7utIncr4pRCMos63TnBkfrl7d43cHQTuK0kO76EWtv4ODEHgLvEAv4HA
2 changes: 1 addition & 1 deletion jwt/provide-vehicle-speed.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
],
"iat": 1516239022,
"exp": 1767225599,
"scope": "read:Vehicle.Width provide:Vehicle.Speed"
"scope": "provide:Vehicle.Speed"
}
2 changes: 1 addition & 1 deletion jwt/provide-vehicle-speed.token
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJsb2NhbCBkZXYiLCJ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