Skip to content

feat(auth): decouple authorization and admin layout #13

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

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

Conversation

jescalada
Copy link
Collaborator

@jescalada jescalada commented Feb 11, 2025

This PR for #9 builds on top of #7 and #10, making route access more intuitive. All /admin routes have been replaced with /dashboard, and relevant files have been renamed. Actual admin-only routes, such as the list of users, are displayed with the /admin/ prefix. For example: /dashboard/admin/user.

Merging the first two PRs should make this one more manageable! 😃

Unit tests execute the same way as before, and E2E tests have been expanded and amended to work with the new setup.

I also added some quality-of-life features, such as fixing the redirect on login, which had a confusing flow (that was erroring out when logging from the admin/admin account).

When testing, keep in mind that enabling OIDC will make some tests fail. Please set the local auth in proxy.config.json to enabled: true (and openidconnect to enabled: false) to make tests pass. Thank you!

Changelog

  • Refactor "admin" layout/routes into "dashboard"
  • Fix redirect on login (now redirects to repo list, which requires a logged-in user)
  • Fix error handling on repo page
    • Catches GitHub repo retrieval error and makes it more descriptive
  • Add new E2E test for basic login flow (with admin/admin account) and redirect
  • Fix login command
    • Needed to fix the existing repo E2E test which now requires a logged-in user

@jescalada jescalada self-assigned this Feb 11, 2025
@jescalada jescalada linked an issue Feb 11, 2025 that may be closed by this pull request
@jescalada jescalada changed the title Decouple authorization and admin layout feat(auth): decouple authorization and admin layout Mar 10, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 10, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 58.29960% with 412 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@83e814b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/proxy/processors/push-action/gitleaks.ts 11.62% 76 Missing ⚠️
src/config/ConfigLoader.ts 62.22% 59 Missing and 9 partials ⚠️
src/config/index.ts 69.42% 42 Missing and 6 partials ⚠️
src/proxy/processors/push-action/preReceive.ts 16.32% 41 Missing ⚠️
src/proxy/index.ts 33.33% 36 Missing and 2 partials ⚠️
src/db/file/repo.ts 50.00% 23 Missing ⚠️
src/db/file/pushes.ts 47.05% 18 Missing ⚠️
src/proxy/processors/push-action/parsePush.ts 48.57% 18 Missing ⚠️
src/db/index.ts 42.85% 11 Missing and 5 partials ⚠️
src/proxy/actions/Action.ts 64.10% 14 Missing ⚠️
... and 16 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #13   +/-   ##
=======================================
  Coverage        ?   48.49%           
=======================================
  Files           ?       51           
  Lines           ?     2099           
  Branches        ?      242           
=======================================
  Hits            ?     1018           
  Misses          ?     1044           
  Partials        ?       37           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

06kellyjac and others added 30 commits May 14, 2025 12:28
ci: generate js and definitions from ts and place in original location
add meeting minutes GitHub Issue template
fix(deps): update dependency eslint to ^9.27.0 - website - website/package.json
chore(deps): update github-actions - workflows - .github/workflows/dependency-review.yml
feat: converted to typescript

fix: config loader clone command issue

fix: adds input validation, uses array arguments, prevented shell spawn

fix: adds failsafe checking for directory location and structure

fix: env-paths change to v2.2.1 which support require and minor code fix

fix: improves test coverage

Adds additional tests for better cove

fix: fixed creating cache directory
Default value should be false, and set to true when cert path is configured
feat: implements config loader to enable remote or external configs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decouple route authorization and layout
8 participants