UMA Auth CLI tool for Client Apps.
Project description
UMA Auth CLI
A simple CLI tool for working with UMA auth. Can help with generating new nostr keys and publishing client app info events.
Installation
To run the CLI from source, you can clone this repository and run:
pipenv install --dev
pipenv run python -m build
pip install dist/*.whl
You can then run the CLI from anywhere:
uma-auth-cli --help
To install the CLI as a package from pypi instead, you can run:
# Note: This is not yet published to pypi.
pip install uma-auth-cli
Usage
Key Generation
To generate a new nostr keypair, run:
uma-auth-cli generate-key
It will create and print a new keypair in hex and bech32 format:
nsec1e792rulwmsjanw783x39r8vcm23c2hwcandwahaw6wh39rfydshqxhfm7x
npub13msd7fakpaqerq036kk0c6pf9effz5nn5yk6nqj4gtwtzr5l6fxq64z8x5
sec hex: cf8aa1f3eedc25d9bbc789a2519d98daa3855dd8ecdaeedfaed3af128d246c2e
pub hex: 8ee0df27b60f419181f1d5acfc68292e52915273a12da9825542dcb10e9fd24c
Publishing client app info
You can publish a client app info (kind 13195 and optionally kind 0) using the CLI. The CLI can publish these events in interactive prompt mode:
$ uma-auth-cli publish \
--nsec nsec1mqxnulkqkcv0gc0dfrxz5kz7d3h665ve2dhjkrj8jmmxwm4st2zsjv2n5l \
--relay wss://nos.lol --relay wss://relay.primal.net \
--redirect-uri https://foo.test \
--image https://foo.com/image.png \
--nip05 _@foo.com \
--include-0 \
--name "Test CLI" \
--description "A test client app"
Looking up client app info
You can look up client app info using the CLI:
$ uma-auth-cli lookup \
--npub npub13msd7fakpaqerq036kk0c6pf9effz5nn5yk6nqj4gtwtzr5l6fxq64z8x5 \
--relay wss://nos.lol
Authority Verification
As per NIP-68, you can act as the authority or check authority attestations using the CLI.
Attesting to an app's identity
First, find the app 13195 event ID by using the lookup command. Then, you can attest to the app's identity:
$ uma-auth-cli attest \
--nsec nsec1mqxnulkqkcv0gc0dfrxz5kz7d3h665ve2dhjkrj8jmmxwm4st2zsjv2n5l \
--relay wss://nos.lol \
--app-npub npub13msd7fakpaqerq036kk0c6pf9effz5nn5yk6nqj4gtwtzr5l6fxq64z8x5 \
--event-id bb892e7d7a26e88fe668e65c75eed7fd11619bf6512e8fe12d5bf3ba5db10c90
--nsec
is the nostr keypair secret key of the authority attesting to the app's identity.--relay
is the relay to use to publish the attestation.--app-npub
is the clients app's public key.--event-id
is the event ID of the app's 13195 event.
Looking up attestations
You can look up attestations using the CLI:
$ uma-auth-cli lookup \
--authority nprofile1qqstse98yvaykl3k2yez3732tmsc9vaq8c3uhex0s4qp4dl8fczmp9spp4mhxue69uhkummn9ekx7mq26saje \
--npub npub13msd7fakpaqerq036kk0c6pf9effz5nn5yk6nqj4gtwtzr5l6fxq64z8x5 \
--relay wss://nos.lol
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uma_auth_cli-0.2.1.tar.gz
.
File metadata
- Download URL: uma_auth_cli-0.2.1.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc2ea3d04efdfee73229506eb1738a6ecd9ee55e196f623262b17c41bcd3a4db |
|
MD5 | 059f21c3badbd30351019698d63abb79 |
|
BLAKE2b-256 | 1ffe68c2af8ea9f4bac521a325b65aaa472bbdab579222cd21b7f78c83c21026 |
File details
Details for the file uma_auth_cli-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: uma_auth_cli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480b4349df937784cb1ccaf4ab6a5b7ee6723c122e5fa6876cfc87e3eb21c622 |
|
MD5 | 918b657fec2d6da17a48a8b6c970ed27 |
|
BLAKE2b-256 | e65698403ff5e44d399667d1006dc9f2d4a3a8a128c4ef0e509a08b6f77e7bea |