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

sources: add property mappings for all oauth and saml sources #8771

Merged
merged 95 commits into from
Aug 7, 2024

Conversation

rissson
Copy link
Member

@rissson rissson commented Mar 1, 2024

Details

Next step of #8750.

Also includes #6427

closes #6184
closes #6622
closes #7713


TODO:

  • SAML group infos
  • flow manager group handling
    • tests
  • Oauth tests
    • user pm
    • group pm
  • SAML tests
    • user pm
    • group pm

Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

Docs at #10652

Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@rissson rissson self-assigned this Mar 1, 2024
@rissson rissson requested a review from a team as a code owner March 1, 2024 11:15
Copy link

netlify bot commented Mar 1, 2024

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit ab96d84
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/66b39aa2543ae30008e05f35
😎 Deploy Preview https://deploy-preview-8771--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

rissson added 2 commits March 1, 2024 12:46
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@rissson rissson requested a review from a team as a code owner March 1, 2024 12:25
rissson added 18 commits March 1, 2024 13:26
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Copy link
Contributor

@kensternberg-authentik kensternberg-authentik left a comment

Choose a reason for hiding this comment

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

Overall, this is acceptable with the current dev standards. I'm trying to up those standards, however, and left two notes. Just sayin; if you don't make these changes, they're going onto my "cleanup and dedupe" chores list, and it'd be nice to get these done now.

}
}

renderForm(): TemplateResult {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm trying to discourage return types on methods like these; Lit3 changes the return type of the overall ShadowDOM object, and while this isn't a breaking change, there are others that could be a problem. Lit prefers the symbol nothing as a schedule-aware placeholder (please don't use html'' (imagine those are backticks; hard to render when they're sigils) to indicate "render nothing"), but nothing isn't a TemplateResult and this won't pass a lint check.

In general, TypeScript's "infer return type" algorithm is very good, and I encourage us to start trusting it.

}

renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">
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 like you have at least one major method (the renderForm() method) where it and a lot of the imports that support it could be pushed into a parent class. I don't know if you want to address any of the others, but that renderForm() (35 lines) one is blatant.

Clones found (typescript):

  • PropertyMappingSCIMForm.ts [1:1 - 13:12] (12 lines, 126 tokens)
    PropertyMappingScopeForm.ts [1:1 - 13:13]

  • PropertyMappingSCIMForm.ts [46:23 - 66:2] (20 lines, 55 tokens)
    PropertyMappingScopeForm.ts [73:23 - 93:2]

  • PropertyMappingSAMLSourceForm.ts [1:1 - 13:26] (12 lines, 126 tokens)
    PropertyMappingScopeForm.ts [1:1 - 13:13]

  • PropertyMappingSAMLSourceForm.ts [31:33 - 66:2] (35 lines, 110 tokens)
    PropertyMappingSCIMForm.ts [31:19 - 93:2]

  • PropertyMappingSAMLForm.ts [1:1 - 13:20] (12 lines, 126 tokens)
    PropertyMappingScopeForm.ts [1:1 - 13:13]

  • PropertyMappingSAMLForm.ts [69:70 - 93:2] (24 lines, 58 tokens)
    PropertyMappingScopeForm.ts [69:21 - 93:2]

  • PropertyMappingPlexSourceForm.ts [1:1 - 66:2] (65 lines, 408 tokens)
    PropertyMappingScopeForm.ts [1:1 - 93:2]

  • PropertyMappingOAuthSourceForm.ts [1:1 - 13:27] (12 lines, 123 tokens)
    PropertyMappingScopeForm.ts [1:1 - 13:20]

  • PropertyMappingOAuthSourceForm.ts [31:34 - 66:2] (35 lines, 110 tokens)
    PropertyMappingSCIMForm.ts [31:19 - 93:2]

  • PropertyMappingNotification.ts [37:34 - 72:2] (35 lines, 110 tokens)
    PropertyMappingSCIMForm.ts [31:19 - 93:2]

  • PropertyMappingLDAPSourceForm.ts [1:1 - 13:26] (12 lines, 123 tokens)
    PropertyMappingScopeForm.ts [1:1 - 13:20]

  • PropertyMappingLDAPSourceForm.ts [31:33 - 66:2] (35 lines, 110 tokens)
    PropertyMappingSCIMForm.ts [31:19 - 93:2]

rissson added 5 commits August 1, 2024 17:28
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
rissson added 4 commits August 1, 2024 19:27
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@rissson rissson removed the deploy_me Deploy the PR changes on a test environment label Aug 1, 2024
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@rissson rissson added deploy_me Deploy the PR changes on a test environment and removed deploy_me Deploy the PR changes on a test environment labels Aug 2, 2024
@rissson rissson requested a review from BeryJu August 5, 2024 11:02
@rissson rissson mentioned this pull request Aug 5, 2024
6 tasks
authentik/core/models.py Outdated Show resolved Hide resolved
authentik/core/api/sources.py Outdated Show resolved Hide resolved
rissson and others added 2 commits August 7, 2024 17:55
Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@rissson rissson requested a review from BeryJu August 7, 2024 15:55
@rissson rissson merged commit 83b02a1 into main Aug 7, 2024
70 checks passed
@rissson rissson deleted the source-flow-manager-property-mappings branch August 7, 2024 17:14
@BeryJu BeryJu mentioned this pull request Aug 7, 2024
7 tasks
kensternberg-authentik added a commit that referenced this pull request Aug 7, 2024
* main:
  web/admin: refactor property mappings forms (#10810)
  web: bump API Client version (#10811)
  sources/saml: Basic support for EncryptedAssertion element. (#10099)
  web: bump API Client version (#10809)
  sources: add property mappings for all oauth and saml sources (#8771)
  web: bump API Client version (#10808)
  stages/authenticator: add created, last_updated and last_used metadata (#10636)
  providers/proxy: avoid erroring on logout with session_id is None (#9119)
  core: bump google-api-python-client from 2.139.0 to 2.140.0 (#10802)
  core: bump pyyaml from 6.0.1 to 6.0.2 (#10803)
  core: bump django from 5.0.7 to 5.0.8 (#10804)
  core: bump goauthentik.io/api/v3 from 3.2024063.1 to 3.2024063.2 (#10805)
  web: bump @sentry/browser from 8.23.0 to 8.24.0 in /web in the sentry group across 1 directory (#10806)
  web: bump the wdio group across 2 directories with 2 updates (#10807)
kensternberg-authentik added a commit that referenced this pull request Aug 8, 2024
* main: (25 commits)
  website/docs: add link from Install docs to Enterprise docs (#10827)
  website/docs: new upgrade page (#10742)
  stages/authenticator: actually update last_used (#10813)
  sources/ldap: Add enabled filter for ldap_password_validate signal (#10823)
  web: bump API Client version (#10821)
  sources/plex: add property mappings (#10772)
  core: bump goauthentik.io/api/v3 from 3.2024063.2 to 3.2024063.5 (#10817)
  web: bump the wdio group across 2 directories with 4 updates (#10818)
  web: bump chromedriver from 127.0.1 to 127.0.2 in /tests/wdio (#10819)
  web: update to ESLint 9 (#10812)
  website/docs: add source property mappings, rework provider property mappings (#10652)
  web/admin: refactor property mappings forms (#10810)
  web: bump API Client version (#10811)
  sources/saml: Basic support for EncryptedAssertion element. (#10099)
  web: bump API Client version (#10809)
  sources: add property mappings for all oauth and saml sources (#8771)
  web: bump API Client version (#10808)
  stages/authenticator: add created, last_updated and last_used metadata (#10636)
  providers/proxy: avoid erroring on logout with session_id is None (#9119)
  core: bump google-api-python-client from 2.139.0 to 2.140.0 (#10802)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants