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

feat: add login via Reunite API #1878

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

feat: add login via Reunite API #1878

wants to merge 6 commits into from

Conversation

tatomyr
Copy link
Contributor

@tatomyr tatomyr commented Feb 3, 2025

What/Why/How?

  • Added the ability to log in via Reunite API with --next flag
  • Renamed folder cms/ to reunite/ for clarity
  • Renamed the --region option to --residency as it may take a full domain alongside us and eu (but retained --region alias for backward compatibility)

Reference

Internal request: https://github.com/Redocly/openapi-vs-code/issues/231#issuecomment-2598584274

Testing

Screenshots (optional)

Old login:

image

New login:
image

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Copy link

changeset-bot bot commented Feb 3, 2025

🦋 Changeset detected

Latest commit: 7fa1c11

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@redocly/cli Minor
@redocly/openapi-core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Feb 3, 2025

Command Mean [s] Min [s] Max [s] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 1.094 ± 0.038 1.039 1.143 1.00
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 1.121 ± 0.039 1.086 1.191 1.02 ± 0.05

Copy link
Contributor

github-actions bot commented Feb 3, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.23% 5136/6565
🟡 Branches 66.94% 2073/3097
🟡 Functions 72.89% 847/1162
🟡 Lines 78.48% 4846/6175
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / auth.ts
25.81% 0% 0% 25.81%
🟢
... / oauth-client.ts
90.91% 75% 100% 90.74%
🔴
... / device-flow.ts
41.38% 29.41% 38.46% 39.29%
🟢
... / api-client.ts
82.86% 65.79% 87.5% 82.52%
🟢
... / index.ts
100% 100% 100% 100%
🟢
... / domains.ts
100% 100% 100% 100%
🟢
... / api-keys.ts
100% 100% 100% 100%
🟢
... / push.ts
90.41% 63.64% 100% 90.14%
🟢
... / push-status.ts
92.68% 76.56% 100% 92.68%
🟢
... / utils.ts
100% 100% 100% 100%
🟢
... / utils.ts
100% 80% 100% 100%

Test suite run success

853 tests passing in 122 suites.

Report generated by 🧪jest coverage report action from 7fa1c11

@tatomyr tatomyr force-pushed the feat/add-new-login branch 2 times, most recently from f871e39 to b322d4b Compare February 4, 2025 09:47
@tatomyr tatomyr marked this pull request as ready for review February 4, 2025 09:55
@tatomyr tatomyr requested review from a team as code owners February 4, 2025 09:55
@DmitryAnansky
Copy link
Contributor

Should we update some documentation?

export function promptClientToken(domain: string) {
return promptUser(
green(
`\n 🔑 Copy your API key from ${blue(`https://app.${domain}/profile`)} and paste it below`
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks to me that for now this message is misleading.
We don't apply new isAuthorized() function anywhere yet, and this will not have any effect on previously protected code.
Please correct me if I am wrong.

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 still support the old login which is needed to render Reference Docs with the preview-docs command. At the same time we need the isAuthorized method to use it in places that will require auth (probably in the VS Code extension).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but will preview-docs work if you run new login ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can change the message text.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will preview-docs work if you run new login ?

No, I doubt it makes sense since Reference Docs are only related to our previous product. And also, it won't allow to push to the Redocly registry.

@RomanHotsiy could you check if the message is OK or could be improved?

@tatomyr tatomyr force-pushed the feat/add-new-login branch from 6001ddd to 4f55a28 Compare February 4, 2025 13:14
@tatomyr tatomyr requested a review from JLekawa February 4, 2025 13:18
docs/commands/login.md Outdated Show resolved Hide resolved
docs/commands/login.md Outdated Show resolved Hide resolved
docs/commands/login.md Outdated Show resolved Hide resolved
@tatomyr tatomyr force-pushed the feat/add-new-login branch from 3e01b13 to 11cd44a Compare February 4, 2025 16:14
@tatomyr tatomyr force-pushed the feat/add-new-login branch from 54ccc40 to f71bdc3 Compare February 5, 2025 11:26
@tatomyr tatomyr force-pushed the feat/add-new-login branch from f71bdc3 to 7fa1c11 Compare February 7, 2025 09:02
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.

4 participants