Skip to content

Conversation

@jiparis
Copy link
Member

@jiparis jiparis commented Aug 27, 2024

This PR configures the control plane to generate a new user on first bootstrap, and print a valid user token (1 month) in the logs. This way, it can be used in the auth login --skip-browser workflow without needing a GUI.

If enabled, Chainloop logs will print a message like this:

2024-08-27T17:13:39.774+0200    INFO    {"component": "service", "msg": "******************* DEVELOPMENT USER TOKEN *******************"}
2024-08-27T17:13:39.774+0200    INFO    {"component": "service", "msg": "Use chainloop 'auth login --skip-browser' and paste this token to start a headless session: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.REDACTED"}

And then:

> chainloop --insecure auth login --skip-browser
WRN API contacted in insecure mode
WRN Both user credentials and $CHAINLOOP_TOKEN set. Ignoring $CHAINLOOP_TOKEN.
To authenticate, click on the following link and paste the result back here

  http://0.0.0.0:8000/auth/login?long-lived=true

Enter Token:

> chainloop --insecure org ls
WRN API contacted in insecure mode
WRN Both user credentials and $CHAINLOOP_TOKEN set. Ignoring $CHAINLOOP_TOKEN.
you are not part of any organization, please run "chainloop organization create --name ORG_NAME" to create one

Tested building the image locally and and running it with compose.labs.yaml

Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis requested review from javirln and migmartri August 27, 2024 15:22
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis merged commit b9e20b8 into chainloop-dev:main Aug 28, 2024
@jiparis jiparis deleted the PFM-1086-token branch August 28, 2024 07:07
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.

2 participants