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

Account get and udpate apis #14

Merged
merged 12 commits into from
Oct 4, 2024
Merged

Account get and udpate apis #14

merged 12 commits into from
Oct 4, 2024

Conversation

anekkanti
Copy link
Member

No description provided.

@anekkanti anekkanti requested review from cretz and a team December 4, 2023 22:16
bool enabled = 1;
// The base64 encoded ca cert(s) in PEM format that clients connecting to the metrics endpoint can use for authentication.
// This must only be one value, but the CA can have a chain.
string accepted_client_ca = 2;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
string accepted_client_ca = 2;
bytes accepted_client_ca = 2;

Why not just accept the PEM instead of base64 encoded (which is what proto JSON will be anyways FWIW)

Copy link
Member Author

Choose a reason for hiding this comment

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

We are accepting the cert as a string for the namespace spec.
https://github.com/temporalio/api-cloud/blob/main/temporal/api/cloud/namespace/v1/message.proto#L27
I would rather keep them consistent.

Copy link
Member

Choose a reason for hiding this comment

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

This was my fault for not checking that well enough. PEM is already mostly base64, it's a bit weird to double encode. But I guess it's up to y'all.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we keep the double-encoding, we should add to the comment about this. Regardless of bytes or strings, I would have expected that base64 encoded ca cert(s) means PEM format.

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 think the idea with base64 encoding is to make it safer to pass pem formatted certs which has multi-line content that could cause all kind of issues if not handled correctly.

Copy link
Member

@cretz cretz Dec 6, 2023

Choose a reason for hiding this comment

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

Why is base64 string here easier than bytes for that use case? Of course when using via HTTP API or proto JSON, bytes is just base64 string. If you have concerns about character encoding like newlines, you should use bytes. I think it's unfortunate that because we didn't accept bytes before that's being used to disallow proper use of that data type.

Copy link
Member

Choose a reason for hiding this comment

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

if we don't want to change the namespace spec (since I guess it's public preview), the other alternative is to just add another field which takes bytes to both account/namespace and then eventually deprecate the string field?

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, changed the type to []byte. Which expects the raw pem certs.

temporal/api/cloud/account/v1/message.proto Show resolved Hide resolved
temporal/api/cloud/cloudservice/v1/service.proto Outdated Show resolved Hide resolved
temporal/api/cloud/cloudservice/v1/service.proto Outdated Show resolved Hide resolved
temporal/api/cloud/cloudservice/v1/service.proto Outdated Show resolved Hide resolved
// The next update operation will have to include this version.
string resource_version = 2;
// The current state of the account.
// Possible values: activating, activationfailed, active, updating, updatefailed, deleting, deletefailed, deleted, suspending, suspendfailed, suspended.
Copy link
Member

@mastermanu mastermanu Dec 13, 2023

Choose a reason for hiding this comment

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

remember, let's remove suspendfailed, suspending from here and other places

@@ -60,6 +60,8 @@ message User {
// The user specification
UserSpec spec = 3;
// The current state of the user
// Possible values: activating, activationfailed, active, updating, updatefailed, deleting, deletefailed, deleted, suspending, suspendfailed, suspended.
// For any failed state, reach out to Temporal Cloud support for remediation.
string state = 4;
Copy link
Member

Choose a reason for hiding this comment

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

We should consider making this an enum, but up to y'all.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is becoming an enum in a different PR.

@anekkanti anekkanti merged commit dd93c3e into main Oct 4, 2024
3 checks passed
@anekkanti anekkanti deleted the abhinav/accountManagement branch October 4, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants