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

[OPIK-548] List LLM Provider api keys #864

Merged

Conversation

BorisTkachenko
Copy link
Contributor

Details

List LLM Provider api keys

Testing

Added corresponding integration tests

Documentation

https://www.notion.so/cometml/Online-Scoring-HLD-14d7124010a380508f32fdbd541e5705

@BorisTkachenko BorisTkachenko self-assigned this Dec 11, 2024
@BorisTkachenko BorisTkachenko requested a review from a team as a code owner December 11, 2024 14:34
}

public static String encrypt(String data) {
init();
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

As key is now nullable, I suggest validating it's not null to avoid NPE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We set key at the application boot-up, so it will never be null.
I would rather not add additional checks here, since this scenario is not feasible. If you insist I could add it, but seems unnecassary.

Copy link
Contributor

Choose a reason for hiding this comment

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

the annotations also serve as documentation and to guarantee new usage will respect the constraints. Basically all public methods should have it

Copy link
Contributor Author

@BorisTkachenko BorisTkachenko Dec 11, 2024

Choose a reason for hiding this comment

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

@thiagohora I added annotations to public methods. But it's not related to what Ido is concerned. key is a private field and is not a part of public api.

assertPage(actualProviderApiKeyPage, List.of());

// Create LLM Provider api key
var expectedProviderApiKey = llmProviderApiKeyResourceClient.createProviderApiKey(providerApiKey, apiKey,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that in the case of list logic, it's worth to create several api keys

Copy link
Contributor Author

@BorisTkachenko BorisTkachenko Dec 11, 2024

Choose a reason for hiding this comment

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

It's impossible for now:) Requirements are that one workspace can have only 1 key per provider. And now we are going to support only 1 provider.

@BorisTkachenko BorisTkachenko force-pushed the boryst/OPIK-548-endpoint-store-and-masked-list-api-keys branch from d29484c to 885b30c Compare December 11, 2024 17:30
@BorisTkachenko BorisTkachenko force-pushed the boryst/OPIK-548-endpoint-store-and-masked-list-api-keys branch from 99c547f to 4aa28c9 Compare December 11, 2024 19:41
thiagohora
thiagohora previously approved these changes Dec 11, 2024
Copy link
Contributor

@thiagohora thiagohora left a comment

Choose a reason for hiding this comment

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

Great job!

@BorisTkachenko BorisTkachenko merged commit 363b14f into main Dec 12, 2024
7 checks passed
@BorisTkachenko BorisTkachenko deleted the boryst/OPIK-548-endpoint-store-and-masked-list-api-keys branch December 12, 2024 08:27
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.

3 participants