Skip to main content

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

Metadata

Release files for uma-auth-cli 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uma-auth-cli 0.2.1
File Size Uploaded Provenance Actions
uma_auth_cli-0.2.1.tar.gz 9.3 kB Without provenance Details for uma_auth_cli-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uma-auth-cli 0.2.1
File Interpreter ABI Platform Actions
uma_auth_cli-0.2.1-py3-none-any.whl Python 3 none any Details for uma_auth_cli-0.2.1-py3-none-any.whl

Total release size: 19.0 kB

Release files / uma_auth_cli-0.2.1.tar.gz

Download URL uma_auth_cli-0.2.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bc2ea3d04efdfee73229506eb1738a6ecd9ee55e196f623262b17c41bcd3a4db
BLAKE2b-256 checksum
How to use checksums
1ffe68c2af8ea9f4bac521a325b65aaa472bbdab579222cd21b7f78c83c21026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.16

Release files / uma_auth_cli-0.2.1-py3-none-any.whl

Download URL uma_auth_cli-0.2.1-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
480b4349df937784cb1ccaf4ab6a5b7ee6723c122e5fa6876cfc87e3eb21c622
BLAKE2b-256 checksum
How to use checksums
e65698403ff5e44d399667d1006dc9f2d4a3a8a128c4ef0e509a08b6f77e7bea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.16

Security for uma-auth-cli 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page