Closed YourTechBud closed 1 year ago
API: Post : /sc/v1/login Payload:
Post
/sc/v1/login
{"username": "", "password": "<in clear text>"}
Response Payload
{"token": "<jwt token (hsa algo>"}
JWT Payload:
{"sub": "<username>", "exp": "<2hr>"}
We will consider changing password hashing in the near future.
API: Post : /sc/v1/refresh-token Payload: NO Request Body
/sc/v1/refresh-token
Assumptions:
--admin.secret
ADMIN_SECRET
--admin.username
ADMIN_USERNAME
--admin.password
ADMIN_PASSWORD
spacectl login
Attempts to login into SC to verify username and password and stores the same in a config file.
Behaiviour:
--url
--username
--password
--password-stdin
$HOME/.space-cloud/creds.json
Note: All spacectl command outputs should use this library: https://github.com/pterm/pterm
If you want this feature to be implemented, give it a thumbs up reaction, so that we can determine which features are important to you. 👍
Create a backend api for user to login into SpaceCloud.
API for login
API:
Post
:/sc/v1/login
Payload:Response Payload
JWT Payload:
We will consider changing password hashing in the near future.
API for Refreshing token (For the UI)
API:
Post
:/sc/v1/refresh-token
Payload: NO Request BodyResponse Payload
Assumptions:
--admin.secret
(ADMIN_SECRET
)--admin.username
(ADMIN_USERNAME
)--admin.password
(ADMIN_PASSWORD
)Create
spacectl login
command:Attempts to login into SC to verify username and password and stores the same in a config file.
Behaiviour:
--url
--username
--password
--password-stdin
(to accept password via. std input)$HOME/.space-cloud/creds.json
. Base64 encode username and password fields. This file will contain:Note: All spacectl command outputs should use this library: https://github.com/pterm/pterm