Skip to content

RSDK-14414 Add UserPermission list to AuthConfig - #885

Open
Benjamin Rewis (benjirewis) wants to merge 4 commits into
viamrobotics:mainfrom
benjirewis:perms
Open

RSDK-14414 Add UserPermission list to AuthConfig#885
Benjamin Rewis (benjirewis) wants to merge 4 commits into
viamrobotics:mainfrom
benjirewis:perms

Conversation

@benjirewis

@benjirewis Benjamin Rewis (benjirewis) commented Jul 27, 2026

Copy link
Copy Markdown
Member

RSDK-14414

Adds the API specified in the scope.

@github-actions github-actions Bot added the safe to test committer is a member of this org label Jul 27, 2026
@benjirewis Benjamin Rewis (benjirewis) changed the title [wip] Permissions API changes RSDK-14414 Add UserPermission list to AuthConfig Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


// A User describes a single user that a set of Permissions applies to.
message User {
// type is the type of user. Can be "api-key-id", "email", or "default".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a known set should it be an enum instead of stringly typed?

Could also do a oneof but the code that generates has a kind of disguisting level of nesting:

Oneof with sub messages
message UserPermission {
  repeated Permission permissions = 1;

  message EmailUser {
    string email = 1;
  }

  message APIKeyUser {
    string key = 1;
  }

  message DefaultUser {}

  // user is the User this UserPermission applies to. A User can only be
  // listed in a single UserPermission for a set of UserPermissions.
  oneof user {
    EmailUser email = 2;
    APIKeyUser api = 3;
    DefaultUser default = 4;
  }
}
func test() {
	up := UserPermission{
		User: &UserPermission_Api{
			Api: &UserPermission_APIKeyUser{
				Key: "",
			},
		},
	}
}

Some of that nesting can be removed by not defining custom messages but that would make it annoying to update if the api case needed extra fields in the future or something:

Oneof with a level of nesting removed
message UserPermission {
  repeated Permission permissions = 1;

  // user is the User this UserPermission applies to. A User can only be
  // listed in a single UserPermission for a set of UserPermissions.
  oneof user {
    string email = 2;
    string api = 3;
    google.protobuf.Empty default = 4;
  }
}
func test() {
	up := UserPermission{
		User: &UserPermission_Api{
			Api: "",
		},
	}
}

I really want oneof to be useful but enum is probably good enough.

@jmatth Josh Matthews (jmatth) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, wrong button on that last one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test committer is a member of this org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants