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

Docs: update API access for new token type #1958

Merged
merged 21 commits into from
Sep 15, 2022
Merged

Docs: update API access for new token type #1958

merged 21 commits into from
Sep 15, 2022

Conversation

Tymek
Copy link
Member

@Tymek Tymek commented Aug 23, 2022

About the changes

Documentation for roadmap item #1875 (Embedded proxy)

https://linear.app/unleash/issue/1-152/embedded-proxy-documentation

@vercel
Copy link

vercel bot commented Aug 23, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
unleash ✅ Ready (Inspect) Visit Preview Sep 13, 2022 at 9:05AM (UTC)
unleash-docs ✅ Ready (Inspect) Visit Preview Sep 13, 2022 at 9:05AM (UTC)
1 Ignored Deployment
Name Status Preview Updated
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Sep 13, 2022 at 9:05AM (UTC)

@github-actions
Copy link

github-actions bot commented Aug 23, 2022

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
88.74% (-2.63% 🔻)
6858/7728
🟡 Branches 79.35% 1095/1380
🟢 Functions
82.39% (-3.83% 🔻)
1928/2340
🟢 Lines
89.09% (-2.21% 🔻)
6355/7133

⚠️ Details were not displayed: the report size has exceeded the limit.

Test suite run success

1146 tests passing in 188 suites.

Report generated by 🧪jest coverage report action from 8927e8d

@thomasheartman
Copy link
Contributor

@Tymek Sorry! The review isn't done yet 🙇🏼 The overall comment was also just a draft and not meant to be posted just yet. I'll continue now

Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

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

Alright, sorry about the double review, but I finally got through everything 😅 Great work on this! 🙌🏼 I've got a few nits here, but it's mostly small fry and I've tried to include suggestions for everything, so it should hopefully be easy to see what I mean or to just add my suggestions if you agree.

If there's anything you disagree with or the like, please don't hesitate to let me know.

Regarding the comment that I accidentally added to my previous review, please let me expand on it a bit:

The 'username' field of the API token creation form is confusing, because we're not actually asking for a username at all. We're asking the users what they'd like to call the token. (We've had questions about this!) I'm personally very surprised that the field apparently isn't required to be unique either. So for that, I think this is the time to change the name of the field in the application to something like "token identifier" or "token name". What do you think?

Left to do

Before it can go in, I think we also have to update the api tokens and client keys article with:

  1. A detailed description of what settings are used to create an API token (username, projects, environments, token type)
  2. A new section on FRONTEND tokens

Discussion

Are we happy with using "frontend" as the url for the API (and the token type etc)? Is that the name of it? It seems like we're calling the API the "direct access API" (unless I misunderstood, that is), so maybe that's more appropriate? 🤷🏼

website/docs/user_guide/token.mdx Outdated Show resolved Hide resolved
website/docs/user_guide/token.mdx Outdated Show resolved Hide resolved
website/sidebars.js Outdated Show resolved Hide resolved
website/sidebars.js Outdated Show resolved Hide resolved
website/docs/sdks/proxy-svelte.md Outdated Show resolved Hide resolved
website/docs/sdks/proxy-vue.md Outdated Show resolved Hide resolved
website/docs/sdks/unleash-proxy.md Outdated Show resolved Hide resolved
website/docs/user_guide/important-concepts.md Outdated Show resolved Hide resolved
`website/docs/user_guide/token.mdx`

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
`website/docs/topics/frontend-api.md`

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

### Cross-origin resource sharing (CORS) configuration {#cors}

You need to allow traffic from your application domains to use the Unleash front-end API with web and hybrid mobile applications. You can update the front-end API CORS settings from the Unleash UI under _admin \> CORS_ or by using the API.
Copy link
Contributor

Choose a reason for hiding this comment

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

@Tymek I almost forgot about this! What's the API for this? We probably won't have the docs until the OpenAPI integration is ready, but what's the url? /api/admin/cors?

Copy link
Member Author

Choose a reason for hiding this comment

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

How to set it with admin API? I think it's api/admin/ui-config, POST with frontend settings.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that's what I was wondering about. Seems strange that it's a UI config thing, though?

Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

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

Super nice work! 🙌🏼 let's get this in 😄 I think we can handle the one thing about the API later once we get the openapi docs in.

@Tymek Tymek merged commit 2cd5028 into main Sep 15, 2022
@Tymek Tymek deleted the docs/frontend-token branch September 15, 2022 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants