Skip to content

Create first robot-account during workflow creation #90

@migmartri

Description

@migmartri

Usuallym the steps required to create and use a workflow are

Create a workflow chainloop wf create

$ chainloop wf create --name test --project test
┌──────────────────────────────────────┬──────┬─────────┬─────────────────────┬────────┬─────────────────┐
│ ID                                   │ NAME │ PROJECT │ CREATED AT          │ RUNNER │ LAST RUN STATUS │
├──────────────────────────────────────┼──────┼─────────┼─────────────────────┼────────┼─────────────────┤
│ 71de5436-ef9e-4f27-99c6-a67826f7c0a5 │ testtest    │ 24 Apr 23 14:09 UTC │        │                 │
└──────────────────────────────────────┴──────┴─────────┴─────────────────────┴────────┴─────────────────┘

Create a robot account pointing to that workflow ID

$ chainloop wf robot-account create --workflow 71de5436-ef9e-4f27-99c6-a67826f7c0a5
┌──────────────────────────────────────┬──────┬──────────────────────────────────────┬─────────────────────┬────────────┐
│ ID                                   │ NAME │ WORKFLOW ID                          │ CREATED AT          │ REVOKED AT │
├──────────────────────────────────────┼──────┼──────────────────────────────────────┼─────────────────────┼────────────┤
│ f1f5cc7d-c7eb-4e84-ae45-3b1437d062a6 │      │ 71de5436-ef9e-4f27-99c6-a67826f7c0a5 │ 24 Apr 23 14:09 UTC │            │
└──────────────────────────────────────┴──────┴──────────────────────────────────────┴─────────────────────┴────────────┘

Save the following token since it will not printed again: 

 eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.REDACTED-I

This task is about by default, create a token as well, unless an optional flag is set that prevents that, i.e --skip-robot-account-create

We need to decide where to implement this, server-side or client-side. My gut tells me, based on the limited information we have, that there is no enough data to corroborate that such a change should be implemented by default in the server. So I am leaning towards a client side implementation of it (although automatic contract creation happens server side)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions