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

Add a way to manage API keys #1136

Merged
merged 2 commits into from
Dec 15, 2023
Merged

Add a way to manage API keys #1136

merged 2 commits into from
Dec 15, 2023

Conversation

Karakatiza666
Copy link
Collaborator

@Karakatiza666 Karakatiza666 commented Dec 13, 2023

Is this a user-visible change (yes/no): yes
Fix #1103

image
image

@Karakatiza666 Karakatiza666 added enhancement New feature or request Web Console Related to the browser based UI javascript Pull requests that update Javascript code User-facing For PRs that lead to Feldera-user visible changes labels Dec 13, 2023
Copy link

github-actions bot commented Dec 13, 2023

🤖 Meticulous spotted visual differences in 1 of 6 screens tested: view and approve differences detected.

Last updated for commit b80d8d0. This comment will update as new commits are pushed.

Copy link
Collaborator

@lalithsuresh lalithsuresh left a comment

Choose a reason for hiding this comment

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

Regarding the side bar. I don't think "ecosystem" is the right section for these settings.

API key generation should only be exposed by the UI when using authentication. It should be part of the user profile drop down on the top right.

@@ -8,7 +8,7 @@ use super::{ManagerError, ServerState};

/// Get authentication provider configuration
#[utoipa::path(
path="/config/authentication",
path="/../config/authentication",
Copy link
Collaborator

@lalithsuresh lalithsuresh Dec 13, 2023

Choose a reason for hiding this comment

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

Why is this change required? This was fixed to /config/authentication as part of #1084. ../ also looks sloppy in the API documentation.

Copy link
Collaborator Author

@Karakatiza666 Karakatiza666 Dec 13, 2023

Choose a reason for hiding this comment

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

Otherwise TypeScript generates a url /v0/config/authentication for this action, which is wrong. I understand this path is relative (a subpath), hence the issue?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, now I see why you need this.

Our use of a Servers variable is the issue: https://github.com/feldera/feldera/blob/main/crates/pipeline_manager/src/api/mod.rs#L63

I'll see if I can find a quick workaround so you don't need this change. Basically, we need the /v0 prefix only for the authenticated APIs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Karakatiza666 btw, I've been using the authentication code from the UI just fine. What workflow breaks without the relative pathing?

Copy link
Collaborator Author

@Karakatiza666 Karakatiza666 Dec 13, 2023

Choose a reason for hiding this comment

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

You are just using previous, correct UI code. I generated latest UI OpenAPI bindings and there this issue popped up, so I had to add '/../' to get generated code to behave as before.
I think I added this previously too, actually.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ack. I've opened #1139. See if that fixes your problem. If so, let's merge that and rebase this PR on top of it.

<br />
You will not be able to view API key secret afterwards.
<br />
You should store generated API key yourself.
Copy link
Collaborator

Choose a reason for hiding this comment

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

You will be shown the generated API key only once. You will not be able view it afterwards. Please store it securely. 

@Karakatiza666
Copy link
Collaborator Author

Would it make sense to leave API keys view on the settings page and only show it when authenticated?
I am wary of moving the entire list to account dropdown.

@Karakatiza666
Copy link
Collaborator Author

image

We will need settings page at some point anyway

@lalithsuresh
Copy link
Collaborator

Would it make sense to leave API keys view on the settings page and only show it when authenticated? I am wary of moving the entire list to account dropdown.

I'm fine with that too.

Copy link
Collaborator

@lalithsuresh lalithsuresh left a comment

Choose a reason for hiding this comment

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

LGTM from my side.

@gz
Copy link
Collaborator

gz commented Dec 14, 2023

this goes to an empty page for me? is it because I have no auth (in that case the link should not show up in the first place with no auth)?

image

API key generation should only be exposed by the UI when using authentication. It should be part of the user profile drop down on the top right.

I felt this would be a good place to put this (fwiw in github it's also under user)

<Stack spacing={4}>
{title}
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
<Icon270RingWithBg></Icon270RingWithBg>fetching keys...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<Icon270RingWithBg></Icon270RingWithBg>fetching keys...
<Icon270RingWithBg></Icon270RingWithBg>Fetching keys...

return (
<Stack spacing={4}>
{title}
No api keys generated
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
No api keys generated
No API keys generated

@gz
Copy link
Collaborator

gz commented Dec 14, 2023

I can't see it right now in the browser, but judging from the screenshots I don't think there is need to have a scrollbar here?

image

@Karakatiza666
Copy link
Collaborator Author

The scrollbar only appears to scroll through more than 4 keys

@Karakatiza666
Copy link
Collaborator Author

@gz yes, the keys should only be accessible when auth is enabled. Authentication is the only section in settings, but only temporarily. There is no point to add code to hide the page when it will get filled with content relatively soon

Signed-off-by: George <bulakh.96@gmail.com>
Signed-off-by: George <bulakh.96@gmail.com>
@Karakatiza666 Karakatiza666 merged commit 4e27e64 into main Dec 15, 2023
4 checks passed
@Karakatiza666 Karakatiza666 deleted the api-key branch December 15, 2023 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update Javascript code User-facing For PRs that lead to Feldera-user visible changes Web Console Related to the browser based UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose API key endpoints to use from authenticated UI
3 participants