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

providers/SCIM: improve backchannel signalling #5657

Merged
merged 3 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions authentik/providers/scim/api/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class Meta:
"property_mappings",
"property_mappings_group",
"component",
"assigned_application_slug",
"assigned_application_name",
"assigned_backchannel_application_slug",
"assigned_backchannel_application_name",
"verbose_name",
"verbose_name_plural",
"meta_model_name",
Expand Down
4 changes: 3 additions & 1 deletion authentik/providers/scim/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
@CELERY_APP.task(bind=True, base=MonitoredTask)
def scim_sync(self: MonitoredTask, provider_pk: int) -> None:
"""Run SCIM full sync for provider"""
provider: SCIMProvider = SCIMProvider.objects.filter(pk=provider_pk).first()
provider: SCIMProvider = SCIMProvider.objects.filter(

Check warning on line 45 in authentik/providers/scim/tasks.py

View check run for this annotation

Codecov / codecov/patch

authentik/providers/scim/tasks.py#L45

Added line #L45 was not covered by tests
pk=provider_pk, backchannel_application__isnull=False
).first()
if not provider:
return
self.set_uid(slugify(provider.name))
Expand Down
1 change: 1 addition & 0 deletions authentik/providers/scim/tests/test_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
slug=generate_id(),
)
self.app.backchannel_providers.add(self.provider)
self.provider.save()

Check warning on line 39 in authentik/providers/scim/tests/test_membership.py

View check run for this annotation

Codecov / codecov/patch

authentik/providers/scim/tests/test_membership.py#L39

Added line #L39 was not covered by tests
self.provider.property_mappings.set(
[SCIMMapping.objects.get(managed="goauthentik.io/providers/scim/user")]
)
Expand Down
8 changes: 4 additions & 4 deletions schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39824,11 +39824,11 @@ components:
type: string
description: Get object component so that we know how to edit the object
readOnly: true
assigned_application_slug:
assigned_backchannel_application_slug:
type: string
description: Internal application name, used in URLs.
readOnly: true
assigned_application_name:
assigned_backchannel_application_name:
type: string
description: Application's display Name.
readOnly: true
Expand Down Expand Up @@ -39857,8 +39857,8 @@ components:
format: uuid
nullable: true
required:
- assigned_application_name
- assigned_application_slug
- assigned_backchannel_application_name
- assigned_backchannel_application_slug
- component
- meta_model_name
- name
Expand Down
7 changes: 6 additions & 1 deletion web/src/admin/providers/scim/SCIMProviderViewPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,14 @@ export class SCIMProviderViewPage extends AKElement {
if (!this.provider) {
return html``;
}
return html` <div slot="header" class="pf-c-banner pf-m-info">
return html`<div slot="header" class="pf-c-banner pf-m-info">
${t`SCIM provider is in preview.`}
</div>
${!this.provider?.assignedBackchannelApplicationName
? html`<div slot="header" class="pf-c-banner pf-m-warning">
${t`Warning: Provider is not assigned to an application as backchannel provider.`}
</div>`
: html``}
<div class="pf-c-page__main-section pf-m-no-padding-mobile pf-l-grid pf-m-gutter">
<div class="pf-l-grid__item pf-m-7-col pf-l-stack pf-m-gutter">
<div class="pf-c-card pf-m-12-col pf-l-stack__item">
Expand Down