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 command to generate a tenant authorization token #129

Merged
merged 2 commits into from
Jul 10, 2023

Conversation

elv-peter
Copy link
Contributor

Useful for testing the authd HTTP API at least

Copy link
Contributor

@elv-todd elv-todd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is super helpful, ty!

sample usage:

$ #set paladin demov3 key
$ ./elv-live tenant_auth_token /tnt/wlt/iten4TXq2en3qtu3JREnE5tSLRf9zLod > /tmp/f ; tok=`grep Auth /tmp/f` ; path=`grep iten /tmp/f` ; curl -s -H "$tok" http://localhost:6546$path

Comment on lines 61 to 62
console.log(message)
console.log(`Authorization: Bearer ${multiSig}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we return a YAML that can have message and token? The other commands return YAML (which is both human readable-ish and command line parseable).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~/e/git/elv-live-js $ ./elv-live tenant_auth_token '{"hello":123}'
Network: demov3
Timestamped path or body: {"hello":123,"ts":1689024549073}
Token: Authorization: Bearer ES256K_LtRWGcHG3y9EiRpMu7YKU8doYXmSSXPGgGfpbUjq8PKyMdXrD9Ngn9HhoxARMhovogzG4FnUvwapRyQSZMmzDrM2B
~/e/git/elv-live-js $ ./elv-live tenant_auth_token "/nft/pack/spec/0x59267d3eff5a4a595f6bfb790d18ed6af358653a"
Network: demov3
Timestamped path or body: /nft/pack/spec/0x59267d3eff5a4a595f6bfb790d18ed6af358653a?ts=1689025512273
Token: Authorization: Bearer ES256K_En3WkxJQBgHuLazoZ9NYMkEWiLg9M3vfesccRtd3sdACMzfG3tvEhiA2Xtrqwr74WHqKtHRXJngvdBSEevRvhTxAf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this is valid YAML with the extra colons

@elv-peter elv-peter merged commit 77a3fb4 into main Jul 10, 2023
@elv-peter elv-peter deleted the ptt/gen-tenant-token branch July 10, 2023 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants