Update a system-user from an updated system-user assertion

Hi,

It looks like it’s possible to update a system-user assertion, by just re-posting it to the snapd API with a bumped revision number. However, I can’t see a good way of applying that assertion without removing and re-creating the system-user.

For the v2/users API there is only create and remove actions. Trying create again fails with an error because the user already exists.

It seems like the only option is to remove then create - am I missing something ?

This particular use case is if we need to update the ssh keys.

Cheers,
Just

There is not currently a way to do this through the API, as you found the only way is to remove and recreate the user through the API

ok - thanks for confirming.

Cheers,
Just

One more thing regarding this.

According to the docs, https://core.docs.ubuntu.com/en/guides/manage-devices/ , if the system-user assertion lacks the system-user-authority field, asserts can only be signed with a key registered to the store account in the brand-id field.

I created a new key for signing system-user assertsion, registered it with the our brand account [ which is used in the brand-id field.

However, when I try and add an assertion signed with that key, I get the following error response from snapd:

{"type":"error","status-code":400,"status":"Bad Request","result":{"message":"assert failed: cannot resolve prerequisite assertion: account-key (*****************************************************)"}}

Should snapd be trying to verify the registered key with the store directly ? Or is there some process that should take care of it that only happens at system install ? Something else ?

Cheers,
Just

@ijohnson Couple of things.

  1. Any idea on my follow up question above regarding pgp key ?

  2. Are you a forum admin , or know who is ? Seems like that random reply above is basically spam/phising .

Cheers,
Just

Ahh, I see there is a Moderators group.

@jdstrand Sorry, just picking a single Moderator, could see an obvious way to @ the group. Are you able to remove that spam/phishing post/user user above ?

Cheers,
Just

can you file a LP bug for this please? thanks

Raised: https://bugs.launchpad.net/snapd/+bug/1908086

Cheers,
Just