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: remove public /permissions/me usage #300

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

andrewwylde
Copy link
Contributor

Description

This PR removes the hardcoded request to /developers/me/permissions and instead makes a request to a new endpoint that is more specifically targeted for controlling access to a given product.

@andrewwylde andrewwylde requested a review from a team as a code owner November 8, 2023 15:30
Copy link
Contributor

@Mierenga Mierenga left a comment

Choose a reason for hiding this comment

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

Functionally LGTM, and beautiful cleanup. Only feedback is it looks like there is some optimization we could do on how often the actions endpoint is called when you load a product page. I see 5 calls each time a new product page loads.
Screenshot 2023-11-09 at 1 18 50 PM

src/stores/permissions.ts Outdated Show resolved Hide resolved
@andrewwylde andrewwylde force-pushed the feat/remove-hardcoded-permissions-api branch from 6a4eb73 to dd2932b Compare November 13, 2023 20:28
@andrewwylde
Copy link
Contributor Author

@Mierenga you should see reduced calls now, but there's still some improvements to be made in the router side of things.

@andrewwylde andrewwylde force-pushed the feat/remove-hardcoded-permissions-api branch 3 times, most recently from 441ee8b to 38db910 Compare November 13, 2023 21:25
@andrewwylde andrewwylde enabled auto-merge (squash) November 13, 2023 21:34
@Mierenga
Copy link
Contributor

Saw an oddity when testing locally.

On this branch when navigating to an API Product from the catalog, both versions are shown as selected
Screenshot 2023-11-13 at 5 18 22 PM

On main, it appears as I would expect
Screenshot 2023-11-13 at 5 17 46 PM

Note I don't see this if refreshing the whole page while viewing an API Product, just when navigating from the catalog.

@andrewwylde
Copy link
Contributor Author

@Mierenga bug in kongponents, have a PR up now Kong/kongponents#1843

Will update dependencies when that gets published.

@andrewwylde andrewwylde force-pushed the feat/remove-hardcoded-permissions-api branch from 0e714e1 to 8d595e7 Compare November 14, 2023 22:52
Copy link
Contributor

@Mierenga Mierenga left a comment

Choose a reason for hiding this comment

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

LGTM

@andrewwylde andrewwylde merged commit f86ba90 into main Nov 14, 2023
5 checks passed
@andrewwylde andrewwylde deleted the feat/remove-hardcoded-permissions-api branch November 14, 2023 23:37
rosskukulinski added a commit to rosskukulinski/konnect-portal that referenced this pull request Nov 27, 2023
* Add netlify config

* Feat/footer (#3)

* Add netlify config

* feat: add nav

* fix: tests

* fix(app-reg): show register button even when there is no spec (Kong#234)

* fix(spec-renderer): widen sidebar to max 330px (Kong#235)

* chore(analytics): remove feature flag [MA-2027] (Kong#238)

* fix: add pagination to table view in catalog (Kong#239)

* build(deps): bump cypress from 12.17.1 to 13.1.0 (Kong#231)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump eslint from 8.47.0 to 8.49.0 (Kong#241)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(docs): update status badges to use actions that run on main (Kong#243)

* chore(docs): fix links in README (Kong#244)

* feat: hide spec link in catalog if no versions (Kong#251)

* chore(vitals): drop meta query object (Kong#252)

* build(deps): bump sass from 1.66.1 to 1.67.0 (Kong#245)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump cypress from 13.1.0 to 13.2.0 (Kong#247)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: correct document tree request header (Kong#255)

* build(deps): bump @kong/kongponents from 8.116.2 to 8.123.3 (Kong#242)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build: bump node version to 18.17.1 in nvmrc (Kong#254)

* build(deps): bump semantic-release from 21.1.1 to 22.0.5 (Kong#258)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump lefthook from 1.4.1 to 1.5.0 (Kong#256)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump eslint from 8.49.0 to 8.50.0 (Kong#259)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump sass from 1.67.0 to 1.68.0 (Kong#260)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump eslint-plugin-cypress from 2.14.0 to 2.15.1 (Kong#257)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: truncate long titles in the sidebar (Kong#253)

* style: fix pagination bar alignment (Kong#262)

* style: fix pagination bar catalog alignment (Kong#265)

* refactor: use table for spec reg modal (Kong#266)

* build(deps): bump cypress from 13.2.0 to 13.3.0 (Kong#264)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump eslint from 8.50.0 to 8.51.0 (Kong#274)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump sass from 1.68.0 to 1.69.0 (Kong#273)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @kong/sdk-portal-js from 2.2.0 to 2.3.4 (Kong#272)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump cypress-split from 1.3.8 to 1.4.0 (Kong#271)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @vitejs/plugin-vue from 4.3.1 to 4.4.0 (Kong#270)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* style: align nav dropdown to header (Kong#268)

Co-authored-by: Mike Swierenga <mike.swierenga@konghq.com>

* build(deps): bump @commitlint/cli from 17.7.1 to 17.8.0 (Kong#276)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump cypress-split from 1.4.0 to 1.10.0 (Kong#277)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: add search to my apps list (Kong#267)

* build(deps): bump @commitlint/config-conventional from 17.7.0 to 17.8.0 (Kong#275)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @vue/eslint-config-typescript from 11.0.3 to 12.0.0 (Kong#250)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump eslint from 8.51.0 to 8.52.0 (Kong#280)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump spec-renderer version to allow languages to be customized (Kong#291)

* build(deps): bump @commitlint/cli from 17.8.0 to 18.2.0 (Kong#289)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump vite from 4.4.2 to 4.5.0 (Kong#281)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump eslint-plugin-vue from 9.17.0 to 9.18.1 (Kong#284)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump cypress-split from 1.10.0 to 1.15.4 (Kong#286)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump typescript from 4.9.5 to 5.2.2 (Kong#229)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @commitlint/config-conventional from 17.8.0 to 18.1.0 (Kong#285)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump eslint from 8.52.0 to 8.53.0 (Kong#294)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump cypress from 13.3.0 to 13.4.0 (Kong#295)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump eslint-plugin-import from 2.28.0 to 2.29.0 (Kong#287)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @babel/traverse from 7.22.4 to 7.23.2 (Kong#296)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump word-wrap from 1.2.3 to 1.2.5 (Kong#297)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump semver from 5.7.1 to 5.7.2 (Kong#298)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: bump spec renderer version (Kong#299)

* refactor(nav): convert user dropdown into generic reusable nav dropdown (Kong#301)

* chore(nav): add data-testid for my-apps-item (Kong#302)

* ci: update dependabot.yml (Kong#303)

* chore(deps): bump axios from 0.27.2 to 1.6.0 (Kong#309)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Wylde <andrew.wylde@konghq.com>

* build(deps): bump @kong-ui-public/spec-renderer from 0.12.2 to 0.13.1 (Kong#308)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: remove public /permissions/me usage (Kong#300)

* build(deps): bump @commitlint/config-conventional from 18.1.0 to 18.4.0 (Kong#305)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump cypress from 13.4.0 to 13.5.0 (Kong#304)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @commitlint/cli from 18.2.0 to 18.4.1 (Kong#307)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @kong-ui-public/analytics-chart from 0.8.31 to 0.10.2 (Kong#246)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mihai-peteu <mihai.peteu@konghq.com>
Co-authored-by: Andrew Wylde <andrew.wylde@konghq.com>

* feat: add developer managed scopes to app reg modal (Kong#310)

* test: add tests for scope select (Kong#311)

* chore(deps): bump eslint from 8.53.0 to 8.54.0 (Kong#312)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @vitejs/plugin-vue from 4.4.0 to 4.5.0 (Kong#313)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* style: match multiselect scope styling to figma (Kong#316)

* feat: send selected scopes in the request (Kong#317)

* fix(vite): enable proxied local previews (Kong#318)

* chore(deps): bump @vitejs/plugin-vue-jsx from 3.0.1 to 3.1.0 (Kong#314)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(portal): select granted scopes in multiselect if present (Kong#319)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Mike Swierenga <mike.swierenga@konghq.com>
Co-authored-by: Benjamin PATRON <soulfly.sk8@gmail.com>
Co-authored-by: Mihai <103061463+mihai-peteu@users.noreply.github.com>
Co-authored-by: David Ma <40131297+davidma415@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Wylde <andrew.wylde@konghq.com>
Co-authored-by: mihai-peteu <mihai.peteu@konghq.com>
Co-authored-by: Adam DeHaven <2229946+adamdehaven@users.noreply.github.com>
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.

2 participants