Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APP-3685] feat: add rpc to rename API keys #489

Merged
merged 4 commits into from
May 22, 2024

Conversation

mattjperez
Copy link
Member

@mattjperez mattjperez commented Apr 22, 2024

APP-3685: support renaming in API keys list (backend)

Additional rpc and structs needed for app PR, viamrobotics/app/#4520

Changes:

  • added to app.proto:
message RenameKeyRequest {
  string id = 1;
  string name = 2;
}

message RenameKeyResponse {
  string id = 1;
  string name = 2;
}

@github-actions github-actions bot added the safe to test committer is a member of this org label Apr 22, 2024
@mattjperez mattjperez added the ready-for-protos add this when you want protos to compile on every commit label Apr 23, 2024
proto/viam/app/v1/app.proto Outdated Show resolved Hide resolved
proto/viam/app/v1/app.proto Outdated Show resolved Hide resolved
proto/viam/app/v1/app.proto Outdated Show resolved Hide resolved
}

message RenameKeyResponse {
string token_name = 1;
Copy link
Member

Choose a reason for hiding this comment

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

what is this? I would expect an empty response.

Copy link
Member

Choose a reason for hiding this comment

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

you can blame me! i told him above to parrot it back in case we did any stripping of special characters etc and the name was slightly different than whatever was request. if you hate it though, i dont feel strongly so fine to remove.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agreed that it was a good sanity check. Though I didn't think about whether it would conform to the expected behavior of the related rpcs.

Copy link
Member

Choose a reason for hiding this comment

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

Do our other Key api calls change the key "name" if it is invalid?

Copy link
Member

Choose a reason for hiding this comment

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

Whoops, will try to un-stall this PR. @mattjperez, please ignore this noise and focus on your new team! :)

@stevebriskin:
CreateKeyResponse above:

message CreateKeyResponse {
  string key = 1;
  string id = 2;
}

i.e. we echo back the provided name and send the newly generated ID.

What if I updated these new RPCs to match a bit better:

message RenameKeyRequest {
  string id = 1;
  string name = 2;
}

message RenameKeyResponse {
  string name = 1;
}

Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

Changing RenameKeyResponse to be:

message RenameKeyResponse {
  string id = 1;
  string name = 2;
}

after in person conversation

Copy link
Member

@kim-mishra kim-mishra left a comment

Choose a reason for hiding this comment

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

lgtm!

@ohEmily
Copy link
Member

ohEmily commented May 21, 2024

git reset --hard HEAD~1
git merge main

to catch the changes from main that I was missing to hopefully fix the conflicts in generated files 👍

@ohEmily
Copy link
Member

ohEmily commented May 22, 2024

Waiting on Julia's PR that fixes the checks on this repo.

@ohEmily ohEmily merged commit 25613ac into viamrobotics:main May 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protos-compiled ready-for-protos add this when you want protos to compile on every commit safe to test committer is a member of this org
Projects
None yet
5 participants