Hello Kevin,

in fact the "secret" field is marked to be unique on the whole database.
Which make sharing tokens impossible.

I created an issue for this https://git.lavasoftware.org/lava/lava/issues/216

As described in the ticket, I believe that we should make:
* secret: non unique
* (description, user): unique together

I believe that this would solve your current issue.


Cheers

Le mer. 6 févr. 2019 à 01:04, Kevin Hilman <khilman@baylibre.com> a écrit :
How can you have more than one LAVA user have the same token secret
(e.g. for a notify callback.)?

Example use case:
- LAVA job with notify callbacks using token names
- submited as user "bob", token names of "bob" map to actual token secrets
- job fails
- user "lab-admin" fixes some lab issues, re-submits job
- job passes, but callbacks fail because tokens are associated with user "bob"

Since the re-submitted job runs as user "lab-admin", the same token
names and corresponding secrets don't exist.

Naively, user "lab-admin" tries to copy the token secrets from user
"bob" keeping the same token names, but this fails saying that "secret
already exists".

Why can't different users have the same secrets?

I haven't looked at the code, but this limitation kind of suggests that
the secret itself is the key in the db, which would prevent multiple
secrets of the same.

Kevin








_______________________________________________
Lava-users mailing list
Lava-users@lists.lavasoftware.org
https://lists.lavasoftware.org/mailman/listinfo/lava-users


--
Rémi Duraffort
LAVA Team, Linaro