Skip to content

[DRAFT] feat: [UIE-9051] - IAM RBAC block non-beta route access - #12644

Closed
abailly-akamai wants to merge 4 commits into
linode:developfrom
abailly-akamai:UIE-9051-alt
Closed

[DRAFT] feat: [UIE-9051] - IAM RBAC block non-beta route access#12644
abailly-akamai wants to merge 4 commits into
linode:developfrom
abailly-akamai:UIE-9051-alt

Conversation

@abailly-akamai

Copy link
Copy Markdown
Contributor

Description 📝

Highlight the Pull Request's context and intentions.

Changes 🔄

List any change(s) relevant to the reviewer.

  • ...
  • ...

Scope 🚢

Upon production release, changes in this PR will be visible to:

  • All customers
  • Some customers (e.g. in Beta or Limited Availability)
  • No customers / Not applicable

Target release date 🗓️

Please specify a release date (and environment, if applicable) to guarantee timely review of this PR. If exact date is not known, please approximate and update it as needed.

Preview 📷

Include a screenshot <img src="" /> or video <video src="" /> of the change.

🔒 Use the Mask Sensitive Data setting for security.

💡 For changes requiring multiple steps to validate, prefer a video for clarity.

Before After
📷 📷

How to test 🧪

Prerequisites

(How to setup test environment)

  • ...
  • ...

Reproduction steps

(How to reproduce the issue, if applicable)

  • ...
  • ...

Verification steps

(How to verify changes)

  • ...
  • ...
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All tests and CI checks are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@abailly-akamai abailly-akamai self-assigned this Aug 6, 2025
@abailly-akamai
abailly-akamai requested a review from a team as a code owner August 6, 2025 11:05
@abailly-akamai
abailly-akamai requested review from bnussman-akamai and hasyed-akamai and removed request for a team August 6, 2025 11:05
@abailly-akamai
abailly-akamai marked this pull request as draft August 6, 2025 11:05

if (location.pathname === '/iam') {
navigate({ to: '/iam/users' });
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Default tab redirect (doing this one at the route level can lead to infinite loops)

if (!isIAMEnabled) {
return <NotFound />;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Previous handling which we can now get rid of

iamUsersRoute,
iamUsersCatchAllRoute,
iamRolesCatchAllRoute,
]),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

also cleaned up the route organization 👍

Comment thread packages/manager/src/Router.tsx Outdated
router.update({
context: {
accountSettings,
isIAMEnabled,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

adding this here as well as we're close to merging the main router (we're still using the migration one)

params: { username },
replace: true,
});
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This redirect solution at the route level is a bit more robust than what was put forward in #12643

They achieve more or less the same but this way is less bug prone and more so the "right" way to do it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, thanks @abailly-akamai! I like the router based approach better than embedding code. I've noticed an inconsistency with hard links/refresh compared to click navigation.

router.mov

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@corya-akamai

Ah yeah... I see what is happening. The issue is that we need to make use of beforeLoad as async. When doing a navigation call we already have the true value of isIAMEnabled, but on an initial page load beforeLoad will not wait for our profile and permissions queries to resolve before making a decision since they are happening during hydration. So we need to instead await those queries at the route level, with a custom promise since we can't use a hook in the route definition.

It works now, and this gives us a decent util to manage our redirects in the future (if more are to come) to but I understand this increases the complexity (managing the logic in two places) a bit so I won't be offended if we want to go your route as well. Welcoming suggestions, and up to you!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@abailly-akamai

Awesome thanks! Ya I like blocking at the route #12656

@linode-gh-bot

Copy link
Copy Markdown

Cloud Manager UI test results

🔺 3 failing tests on test run #3 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
3 Failing702 Passing4 Skipped135m 19s

Details

Failing Tests
SpecTest
timerange-verification.spec.tsCloud Manager Cypress Tests→Integration tests for verifying Cloudpulse custom and preset configurations » should implement and validate custom date/time picker for a specific date and time range
linode-storage.spec.tsCloud Manager Cypress Tests→linode storage tab » delete disk
restricted-user-details-pages.spec.tsCloud Manager Cypress Tests→restricted user details pages » should disable action elements and buttons in the 'Linodes' details page

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/cloudpulse/timerange-verification.spec.ts,cypress/e2e/core/linodes/linode-storage.spec.ts,cypress/e2e/core/account/restricted-user-details-pages.spec.ts"

@github-project-automation github-project-automation Bot moved this from Review to Merged in Cloud Manager Aug 7, 2025
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.

3 participants