Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

Introduce meta authContext - #7875

Merged
kulmann merged 5 commits into
masterfrom
introduce-meta-auth-context
Nov 3, 2022
Merged

kulmann merged 5 commits into
masterfrom
introduce-meta-auth-context

Conversation

@kulmann

@kulmann kulmann commented Oct 26, 2022 •

Copy link
Copy Markdown
Contributor

Description

This PR introduces a meta.authContext prop on routes so that we give fine grained control to extension developers which kind of auth context they want to require from ownCloud Web.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@dschmidt dschmidt left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Haven't tested and would be better with https://dev.to/ayc0/typescript-49-satisfies-operator-1e4i but alas ... better than before!

I especially like the very useful runtime/deprecation warnings!

@dschmidt

Copy link
Copy Markdown
Member

When this is merged, please add an entry here: #7338

Might be worth pinning that issue...

@kulmann

kulmann commented Oct 27, 2022

Copy link
Copy Markdown
Contributor Author

When this is merged, please add an entry here: #7338

Might be worth pinning that issue...

It was pinned when I created it in the first place (see screenshot)... thanks for re-pinning. And yes, of course, the deprecation info needs to go into the ticket. :-)

Screenshot 2022-10-27 at 08 59 45

@diocas diocas left a comment

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.

Does what is really necessary for now (even if the presentation is inconsistent: see my comment in the original issue).

@kulmann
kulmann force-pushed the introduce-meta-auth-context branch from 785eedc to 8621d05 Compare October 28, 2022 14:13
@kulmann
kulmann requested a review from dschmidt October 28, 2022 14:39
@kulmann

kulmann commented Oct 28, 2022

Copy link
Copy Markdown
Contributor Author

@dschmidt I re-requested your review, because I added a substantial amount of code... added meta.pageLayout to route definitions, so that devs can not only choose the required authContext but also the rendering layout. Let me know what you think.

@kulmann kulmann changed the title Introduce meta auth context Introduce meta authContext and pageLayout Oct 28, 2022

@dschmidt dschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Codewise the PR seems completely fine to me, I'm just not so enthusiastic about exposing the pageLayout setting. Especially the loading layout seems a bit weird, but then again it's probably not harmful

Comment thread packages/web-runtime/src/App.vue Resolved
@kulmann

kulmann commented Nov 2, 2022

Copy link
Copy Markdown
Contributor Author

Codewise the PR seems completely fine to me, I'm just not so enthusiastic about exposing the pageLayout setting. Especially the loading layout seems a bit weird, but then again it's probably not harmful

You're right, I didn't remember our decision to force all apps into the application layout. The more I think about it, the less I want to expose the pageLayout to developers. Instead I'd rather use the application layout as fallback for anonymous routes (which solves @diocas use case as well). Will discuss with @tbsbdr if we want to drop the plain layout for our own internal anonymous routes as well (like accessDenied page, oidcCallback page, etc)... converting back to draft.

@kulmann
kulmann marked this pull request as draft November 2, 2022 12:20
Introduce meta.authContext to define which kind of context is required
on a route. This gets evaluated for target routes and (if present)
context routes.

The old meta.auth boolean has been deprecated. For now it gets
transformed into the respective meta.authContext value.
All routes in the web mono repo now have a meta.authContext defined.
@kulmann
kulmann marked this pull request as ready for review November 2, 2022 22:15
@kulmann
kulmann force-pushed the introduce-meta-auth-context branch from 2e5256f to b27bc11 Compare November 2, 2022 22:16
@kulmann

kulmann commented Nov 2, 2022

Copy link
Copy Markdown
Contributor Author

Updated the PR to not expose/use the pageLayout prop anymore. As described earlier today, all app routes, including the ones requesting an anonymous context, will render in the Application layout. I kept the plain layout for login, logout, oidcCallback, oidcSilentRedirect, resolvePublicLink and accessDenied. Those were our implicitly anonymous page before. Now they are our implicitly plain-layout pages (they all received an authContext: "anonymous" meta prop in this PR).

@kulmann kulmann changed the title Introduce meta authContext and pageLayout Introduce meta authContext Nov 2, 2022
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2022

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

40.0% 40.0% Coverage
0.0% 0.0% Duplication

@kulmann
kulmann merged commit 775151d into master Nov 3, 2022
@delete-merged-branch
delete-merged-branch Bot deleted the introduce-meta-auth-context branch November 3, 2022 10:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Routes auth config not honoured route.meta.auth should be deprecated and renamed to something more meaningful

3 participants