mirror of
https://github.com/hanzoui/registry-backend.git
synced 2026-10-30 20:30:45 +00:00
1.2 KiB
1.2 KiB
Scripts
Create JWT Token
This script is used to create JWT Token representing an existing user which can then be used to invoke the API Server as an alternative authentication method to firebase auth.
export JWT_SECRET
go run ./scripts/create-jwt-token --user-id "<existing user id>"
Notes:
- You need to use the same values as the JWT_SECRET environment variables defined for the API Server.
- By default, the token will expire in 30 days, which can be overriden using
--expiryflag.
Ban a Publisher
This script is used to invoke ban publisher API using jwt token as authentication.
go run ./scripts/ban-publisher \
--base-url "<base url of the API>" \
--token "<jwt token representing an admin user>" \
--publisher-id "<publisher id to be banned>"
Ban a Node
This script is used to invoke ban publisher API using jwt token as authentication.
go run ./scripts/ban-node \
--base-url "<base url of the API>" \
--token "<jwt token representing an admin user>" \
--publisher-id "<publisher id of the node>"
--node-id "<node id to be banned>"