Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ def update(self, group: Group, connection: GoogleWorkspaceProviderGroup):
google_group = self.to_schema(group, connection)
self.check_email_valid(google_group["email"])
try:
return self._request(
response = self._request(
self.directory_service.groups().update(
groupKey=connection.google_id,
body=google_group,
)
)
connection.attributes = response
connection.save()
except NotFoundSyncException:
# Resource missing is handled by self.write, which will re-create the group
raise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ def update(self, user: User, connection: GoogleWorkspaceProviderUser):
self.check_email_valid(
google_user["primaryEmail"], *[x["address"] for x in google_user.get("emails", [])]
)
self._request(
response = self._request(
self.directory_service.users().update(userKey=connection.google_id, body=google_user)
)
connection.attributes = response
connection.save()

def discover(self):
"""Iterate through all users and connect them with authentik users if possible"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ def update(self, group: Group, connection: MicrosoftEntraProviderGroup):
microsoft_group = self.to_schema(group, connection)
microsoft_group.id = connection.microsoft_id
try:
return self._request(
response = self._request(
self.client.groups.by_group_id(connection.microsoft_id).patch(microsoft_group)
)
connection.attributes = self.entity_as_dict(response)
connection.save()
except NotFoundSyncException:
# Resource missing is handled by self.write, which will re-create the group
raise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ def update(self, user: User, connection: MicrosoftEntraProviderUser):
"""Update existing user"""
microsoft_user = self.to_schema(user, connection)
self.check_email_valid(microsoft_user.user_principal_name)
self._request(self.client.users.by_user_id(connection.microsoft_id).patch(microsoft_user))
response = self._request(
self.client.users.by_user_id(connection.microsoft_id).patch(microsoft_user)
)
connection.attributes = self.entity_as_dict(response)
connection.save()

def discover(self):
"""Iterate through all users and connect them with authentik users if possible"""
Expand Down
7 changes: 4 additions & 3 deletions web/src/flow/FlowInspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import PFProgressStepper from "@patternfly/patternfly/components/ProgressStepper
import PFStack from "@patternfly/patternfly/layouts/Stack/stack.css";
import PFBase from "@patternfly/patternfly/patternfly-base.css";

import { FlowInspection, FlowsApi, Stage } from "@goauthentik/api";
import { FlowInspection, FlowsApi, ResponseError, Stage } from "@goauthentik/api";

@customElement("ak-flow-inspector")
export class FlowInspector extends AKElement {
Expand All @@ -25,7 +25,7 @@ export class FlowInspector extends AKElement {
state?: FlowInspection;

@property({ attribute: false })
error?: Response;
error?: ResponseError;

static get styles(): CSSResult[] {
return [
Expand Down Expand Up @@ -70,6 +70,7 @@ export class FlowInspector extends AKElement {
flowSlug: this.flowSlug,
})
.then((state) => {
this.error = undefined;
this.state = state;
})
.catch((exc) => {
Expand Down Expand Up @@ -100,7 +101,7 @@ export class FlowInspector extends AKElement {
<div class="pf-l-stack pf-m-gutter">
<div class="pf-l-stack__item">
<div class="pf-c-card">
<div class="pf-c-card__body">${this.error?.statusText}</div>
<div class="pf-c-card__body">${this.error?.message}</div>
</div>
</div>
</div>
Expand Down