web: mass update API calls

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-16 18:24:15 +02:00
parent 7152d7ee01
commit ba5374f6e1
64 changed files with 136 additions and 183 deletions

View file

@ -118,7 +118,7 @@ class EventViewSet(ReadOnlyModelViewSet):
)
],
)
@action(detail=False, methods=["GET"])
@action(detail=False, methods=["GET"], pagination_class=None)
def top_per_user(self, request: Request):
"""Get the top_n events grouped by user count"""
filtered_action = request.query_params.get("action", EventAction.LOGIN)

View file

@ -2338,18 +2338,6 @@ paths:
description: Which field to use when ordering the results.
schema:
type: string
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: search
required: false
in: query
@ -2375,7 +2363,9 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedEventTopPerUserList'
type: array
items:
$ref: '#/components/schemas/EventTopPerUser'
description: ''
/api/v2beta/events/notifications/:
get:
@ -16760,41 +16750,6 @@ components:
required:
- pagination
- results
PaginatedEventTopPerUserList:
type: object
properties:
pagination:
type: object
properties:
next:
type: number
previous:
type: number
count:
type: number
current:
type: number
total_pages:
type: number
start_index:
type: number
end_index:
type: number
required:
- next
- previous
- count
- current
- total_pages
- start_index
- end_index
results:
type: array
items:
$ref: '#/components/schemas/EventTopPerUser'
required:
- pagination
- results
PaginatedExpiringBaseGrantModelList:
type: object
properties:

View file

@ -18,7 +18,7 @@ export class TopApplicationsTable extends LitElement {
}
firstUpdated(): void {
new EventsApi(DEFAULT_CONFIG).eventsEventsTopPerUser({
new EventsApi(DEFAULT_CONFIG).eventsEventsTopPerUserList({
action: "authorize_application",
topN: 11,
}).then((events) => {

View file

@ -115,7 +115,7 @@ export class ApplicationForm extends ModelForm<Application, string> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button>
<ul class="pf-c-dropdown__menu" hidden>
${until(new ProvidersApi(DEFAULT_CONFIG).providersAllTypes().then((types) => {
${until(new ProvidersApi(DEFAULT_CONFIG).providersAllTypesList().then((types) => {
return types.map((type) => {
return html`<li>
<ak-forms-modal>

View file

@ -1,4 +1,4 @@
import { CertificateGeneration, CryptoApi } from "authentik-api";
import { CertificateGenerationRequest, CryptoApi } from "authentik-api";
import { CertificateKeyPair } from "authentik-api/src";
import { t } from "@lingui/macro";
import { customElement } from "lit-element";
@ -8,15 +8,15 @@ import { Form } from "../../elements/forms/Form";
import "../../elements/forms/HorizontalFormElement";
@customElement("ak-crypto-certificate-generate-form")
export class CertificateKeyPairForm extends Form<CertificateGeneration> {
export class CertificateKeyPairForm extends Form<CertificateGenerationRequest> {
getSuccessMessage(): string {
return t`Successfully generated certificate-key pair.`;
}
send = (data: CertificateGeneration): Promise<CertificateKeyPair> => {
return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsGenerate({
data: data
send = (data: CertificateGenerationRequest): Promise<CertificateKeyPair> => {
return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsGenerateCreate({
certificateGenerationRequest: data
});
};

View file

@ -1,4 +1,4 @@
import { CertificateKeyPair, CryptoApi } from "authentik-api";
import { CertificateKeyPair, CertificateKeyPairRequest, CryptoApi } from "authentik-api";
import { t } from "@lingui/macro";
import { customElement } from "lit-element";
import { html, TemplateResult } from "lit-html";
@ -29,11 +29,11 @@ export class CertificateKeyPairForm extends ModelForm<CertificateKeyPair, string
if (this.instance) {
return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsPartialUpdate({
kpUuid: this.instance.pk || "",
data: data
patchedCertificateKeyPairRequest: data
});
} else {
return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsCreate({
data: data
certificateKeyPairRequest: data as unknown as CertificateKeyPairRequest
});
}
};
@ -51,14 +51,14 @@ export class CertificateKeyPairForm extends ModelForm<CertificateKeyPair, string
name="certificateData"
?writeOnly=${this.instance !== undefined}
?required=${true}>
<textarea class="pf-c-form-control" required>${ifDefined(this.instance?.certificateData)}</textarea>
<textarea class="pf-c-form-control" required></textarea>
<p class="pf-c-form__helper-text">${t`PEM-encoded Certificate data.`}</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal
name="keyData"
?writeOnly=${this.instance !== undefined}
label=${t`Private Key`}>
<textarea class="pf-c-form-control" >${ifDefined(this.instance?.keyData)}</textarea>
<textarea class="pf-c-form-control" ></textarea>
<p class="pf-c-form__helper-text">${t`Optional Private Key. If this is set, you can use this keypair for encryption.`}</p>
</ak-form-element-horizontal>
</form>`;

View file

@ -29,11 +29,11 @@ export class RuleForm extends ModelForm<NotificationRule, string> {
if (this.instance) {
return new EventsApi(DEFAULT_CONFIG).eventsRulesUpdate({
pbmUuid: this.instance.pk || "",
data: data
notificationRuleRequest: data
});
} else {
return new EventsApi(DEFAULT_CONFIG).eventsRulesCreate({
data: data
notificationRuleRequest: data
});
}
};

View file

@ -32,11 +32,11 @@ export class TransportForm extends ModelForm<NotificationTransport, string> {
if (this.instance) {
return new EventsApi(DEFAULT_CONFIG).eventsTransportsUpdate({
uuid: this.instance.pk || "",
data: data
notificationTransportRequest: data
});
} else {
return new EventsApi(DEFAULT_CONFIG).eventsTransportsCreate({
data: data
notificationTransportRequest: data
});
}
};

View file

@ -141,7 +141,7 @@ export class BoundStagesList extends Table<FlowStageBinding> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button>
<ul class="pf-c-dropdown__menu" hidden>
${until(new StagesApi(DEFAULT_CONFIG).stagesAllTypes().then((types) => {
${until(new StagesApi(DEFAULT_CONFIG).stagesAllTypesList().then((types) => {
return types.map((type) => {
return html`<li>
<ak-forms-modal>

View file

@ -29,17 +29,17 @@ export class FlowForm extends ModelForm<Flow, string> {
if (this.instance) {
writeOp = new FlowsApi(DEFAULT_CONFIG).flowsInstancesUpdate({
slug: this.instance.slug,
data: data
flowRequest: data
});
} else {
writeOp = new FlowsApi(DEFAULT_CONFIG).flowsInstancesCreate({
data: data
flowRequest: data
});
}
const background = this.getFormFile();
if (background) {
return writeOp.then(flow => {
return new FlowsApi(DEFAULT_CONFIG).flowsInstancesSetBackground({
return new FlowsApi(DEFAULT_CONFIG).flowsInstancesSetBackgroundCreate({
slug: flow.slug,
file: background
});

View file

@ -33,11 +33,11 @@ export class StageBindingForm extends ModelForm<FlowStageBinding, string> {
if (this.instance) {
return new FlowsApi(DEFAULT_CONFIG).flowsBindingsUpdate({
fsbUuid: this.instance.pk || "",
data: data
flowStageBindingRequest: data
});
} else {
return new FlowsApi(DEFAULT_CONFIG).flowsBindingsCreate({
data: data
flowStageBindingRequest: data
});
}
};

View file

@ -35,12 +35,12 @@ export class GroupForm extends ModelForm<Group, string> {
if (this.instance?.pk) {
return new CoreApi(DEFAULT_CONFIG).coreGroupsUpdate({
groupUuid: this.instance.pk || "",
data: data
groupRequest: data
});
} else {
data.users = Array.from(this.instance?.users || []) as unknown as Set<number>;
return new CoreApi(DEFAULT_CONFIG).coreGroupsCreate({
data: data
groupRequest: data
});
}
};

View file

@ -31,11 +31,11 @@ export class OutpostForm extends ModelForm<Outpost, string> {
if (this.instance) {
return new OutpostsApi(DEFAULT_CONFIG).outpostsOutpostsUpdate({
uuid: this.instance.pk || "",
data: data
outpostRequest: data
});
} else {
return new OutpostsApi(DEFAULT_CONFIG).outpostsOutpostsCreate({
data: data
outpostRequest: data
});
}
};

View file

@ -30,11 +30,11 @@ export class ServiceConnectionDockerForm extends ModelForm<DockerServiceConnecti
if (this.instance) {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerUpdate({
uuid: this.instance.pk || "",
data: data
dockerServiceConnectionRequest: data
});
} else {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerCreate({
data: data
dockerServiceConnectionRequest: data
});
}
};

View file

@ -31,11 +31,11 @@ export class ServiceConnectionKubernetesForm extends ModelForm<KubernetesService
if (this.instance) {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsKubernetesUpdate({
uuid: this.instance.pk || "",
data: data
kubernetesServiceConnectionRequest: data
});
} else {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsKubernetesCreate({
data: data
kubernetesServiceConnectionRequest: data
});
}
};

View file

@ -180,7 +180,7 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button>
<ul class="pf-c-dropdown__menu" hidden>
${until(new PoliciesApi(DEFAULT_CONFIG).policiesAllTypes().then((types) => {
${until(new PoliciesApi(DEFAULT_CONFIG).policiesAllTypesList().then((types) => {
return types.map((type) => {
return html`<li>
<ak-forms-modal>

View file

@ -64,11 +64,11 @@ export class PolicyBindingForm extends ModelForm<PolicyBinding, string> {
if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsUpdate({
policyBindingUuid: this.instance.pk || "",
data: data
policyBindingRequest: data
});
} else {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsCreate({
data: data
policyBindingRequest: data
});
}
};

View file

@ -126,7 +126,7 @@ export class PolicyListPage extends TablePage<Policy> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button>
<ul class="pf-c-dropdown__menu" hidden>
${until(new PoliciesApi(DEFAULT_CONFIG).policiesAllTypes().then((types) => {
${until(new PoliciesApi(DEFAULT_CONFIG).policiesAllTypesList().then((types) => {
return types.map((type) => {
return html`<li>
<ak-forms-modal>

View file

@ -1,4 +1,4 @@
import { CoreApi, PoliciesApi, Policy, PolicyTestResult } from "authentik-api";
import { CoreApi, PoliciesApi, Policy, PolicyTestRequest, PolicyTestResult } from "authentik-api";
import { t } from "@lingui/macro";
import { customElement, property } from "lit-element";
import { html, TemplateResult } from "lit-html";
@ -8,11 +8,10 @@ import { until } from "lit-html/directives/until";
import { ifDefined } from "lit-html/directives/if-defined";
import "../../elements/forms/HorizontalFormElement";
import "../../elements/CodeMirror";
import { PolicyTest } from "authentik-api/src";
import YAML from "yaml";
@customElement("ak-policy-test-form")
export class PolicyTestForm extends Form<PolicyTest> {
export class PolicyTestForm extends Form<PolicyTestRequest> {
@property({attribute: false})
policy?: Policy;
@ -24,10 +23,10 @@ export class PolicyTestForm extends Form<PolicyTest> {
return t`Successfully sent test-request.`;
}
send = (data: PolicyTest): Promise<PolicyTestResult> => {
return new PoliciesApi(DEFAULT_CONFIG).policiesAllTest({
send = (data: PolicyTestRequest): Promise<PolicyTestResult> => {
return new PoliciesApi(DEFAULT_CONFIG).policiesAllTestCreate({
policyUuid: this.policy?.pk || "",
data: data
policyTestRequest: data
}).then(result => this.result = result);
};

View file

@ -30,11 +30,11 @@ export class DummyPolicyForm extends ModelForm<DummyPolicy, string> {
if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesDummyUpdate({
policyUuid: this.instance.pk || "",
data: data
dummyPolicyRequest: data
});
} else {
return new PoliciesApi(DEFAULT_CONFIG).policiesDummyCreate({
data: data
dummyPolicyRequest: data
});
}
};

View file

@ -31,11 +31,11 @@ export class EventMatcherPolicyForm extends ModelForm<EventMatcherPolicy, string
if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherUpdate({
policyUuid: this.instance.pk || "",
data: data
eventMatcherPolicyRequest: data
});
} else {
return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherCreate({
data: data
eventMatcherPolicyRequest: data
});
}
};

View file

@ -30,11 +30,11 @@ export class PasswordExpiryPolicyForm extends ModelForm<PasswordExpiryPolicy, st
if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordExpiryUpdate({
policyUuid: this.instance.pk || "",
data: data
passwordExpiryPolicyRequest: data
});
} else {
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordExpiryCreate({
data: data
passwordExpiryPolicyRequest: data
});
}
};

View file

@ -31,11 +31,11 @@ export class ExpressionPolicyForm extends ModelForm<ExpressionPolicy, string> {
if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesExpressionUpdate({
policyUuid: this.instance.pk || "",
data: data
expressionPolicyRequest: data
});
} else {
return new PoliciesApi(DEFAULT_CONFIG).policiesExpressionCreate({
data: data
expressionPolicyRequest: data
});
}
};

View file

@ -30,11 +30,11 @@ export class HaveIBeenPwnedPolicyForm extends ModelForm<HaveIBeenPwendPolicy, st
if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesHaveibeenpwnedUpdate({
policyUuid: this.instance.pk || "",
data: data
haveIBeenPwendPolicyRequest: data
});
} else {
return new PoliciesApi(DEFAULT_CONFIG).policiesHaveibeenpwnedCreate({
data: data
haveIBeenPwendPolicyRequest: data
});
}
};

View file

@ -30,11 +30,11 @@ export class PasswordPolicyForm extends ModelForm<PasswordPolicy, string> {
if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordUpdate({
policyUuid: this.instance.pk || "",
data: data
passwordPolicyRequest: data
});
} else {
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordCreate({
data: data
passwordPolicyRequest: data
});
}
};

View file

@ -30,11 +30,11 @@ export class ReputationPolicyForm extends ModelForm<ReputationPolicy, string> {
if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationUpdate({
policyUuid: this.instance.pk || "",
data: data
reputationPolicyRequest: data
});
} else {
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationCreate({
data: data
reputationPolicyRequest: data
});
}
};

View file

@ -29,11 +29,11 @@ export class PropertyMappingLDAPForm extends ModelForm<LDAPPropertyMapping, stri
if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapUpdate({
pmUuid: this.instance.pk || "",
data: data
lDAPPropertyMappingRequest: data
});
} else {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapCreate({
data: data
lDAPPropertyMappingRequest: data
});
}
};

View file

@ -28,11 +28,11 @@ export class PropertyMappingLDAPForm extends ModelForm<SAMLPropertyMapping, stri
if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlUpdate({
pmUuid: this.instance.pk || "",
data: data
sAMLPropertyMappingRequest: data
});
} else {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlCreate({
data: data
sAMLPropertyMappingRequest: data
});
}
};

View file

@ -29,11 +29,11 @@ export class PropertyMappingScopeForm extends ModelForm<ScopeMapping, string> {
if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeUpdate({
pmUuid: this.instance.pk || "",
data: data
scopeMappingRequest: data
});
} else {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeCreate({
data: data
scopeMappingRequest: data
});
}
};

View file

@ -1,4 +1,4 @@
import { CoreApi, PropertyMapping, PropertymappingsApi, PropertyMappingTestResult } from "authentik-api";
import { CoreApi, PolicyTestRequest, PropertyMapping, PropertymappingsApi, PropertyMappingTestResult } from "authentik-api";
import { t } from "@lingui/macro";
import { customElement, property } from "lit-element";
import { html, TemplateResult } from "lit-html";
@ -8,11 +8,10 @@ import { until } from "lit-html/directives/until";
import { ifDefined } from "lit-html/directives/if-defined";
import "../../elements/forms/HorizontalFormElement";
import "../../elements/CodeMirror";
import { PolicyTest } from "authentik-api/src";
import YAML from "yaml";
@customElement("ak-property-mapping-test-form")
export class PolicyTestForm extends Form<PolicyTest> {
export class PolicyTestForm extends Form<PolicyTestRequest> {
@property({attribute: false})
mapping?: PropertyMapping;
@ -24,10 +23,10 @@ export class PolicyTestForm extends Form<PolicyTest> {
return t`Successfully sent test-request.`;
}
send = (data: PolicyTest): Promise<PropertyMappingTestResult> => {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllTest({
send = (data: PolicyTestRequest): Promise<PropertyMappingTestResult> => {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllTestCreate({
pmUuid: this.mapping?.pk || "",
data: data,
policyTestRequest: data,
formatResult: true,
}).then(result => this.result = result);
};

View file

@ -110,7 +110,7 @@ export class ProviderListPage extends TablePage<Provider> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button>
<ul class="pf-c-dropdown__menu" hidden>
${until(new ProvidersApi(DEFAULT_CONFIG).providersAllTypes().then((types) => {
${until(new ProvidersApi(DEFAULT_CONFIG).providersAllTypesList().then((types) => {
return types.map((type) => {
return html`<li>
<ak-forms-modal>

View file

@ -31,11 +31,11 @@ export class LDAPProviderFormPage extends ModelForm<LDAPProvider, number> {
if (this.instance) {
return new ProvidersApi(DEFAULT_CONFIG).providersLdapUpdate({
id: this.instance.pk || 0,
data: data
lDAPProviderRequest: data
});
} else {
return new ProvidersApi(DEFAULT_CONFIG).providersLdapCreate({
data: data
lDAPProviderRequest: data
});
}
};

View file

@ -37,11 +37,11 @@ export class OAuth2ProviderFormPage extends ModelForm<OAuth2Provider, number> {
if (this.instance) {
return new ProvidersApi(DEFAULT_CONFIG).providersOauth2Update({
id: this.instance.pk || 0,
data: data
oAuth2ProviderRequest: data
});
} else {
return new ProvidersApi(DEFAULT_CONFIG).providersOauth2Create({
data: data
oAuth2ProviderRequest: data
});
}
};

View file

@ -41,11 +41,11 @@ export class ProxyProviderFormPage extends ModelForm<ProxyProvider, number> {
if (this.instance) {
return new ProvidersApi(DEFAULT_CONFIG).providersProxyUpdate({
id: this.instance.pk || 0,
data: data
proxyProviderRequest: data
});
} else {
return new ProvidersApi(DEFAULT_CONFIG).providersProxyCreate({
data: data
proxyProviderRequest: data
});
}
};

View file

@ -31,11 +31,11 @@ export class SAMLProviderFormPage extends ModelForm<SAMLProvider, number> {
if (this.instance) {
return new ProvidersApi(DEFAULT_CONFIG).providersSamlUpdate({
id: this.instance.pk || 0,
data: data
sAMLProviderRequest: data
});
} else {
return new ProvidersApi(DEFAULT_CONFIG).providersSamlCreate({
data: data
sAMLProviderRequest: data
});
}
};

View file

@ -1,4 +1,4 @@
import { LDAPSource, SourcesApi, PropertymappingsApi } from "authentik-api";
import { LDAPSource, SourcesApi, PropertymappingsApi, LDAPSourceRequest } from "authentik-api";
import { t } from "@lingui/macro";
import { customElement } from "lit-element";
import { html, TemplateResult } from "lit-html";
@ -31,11 +31,11 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
if (this.instance) {
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapPartialUpdate({
slug: this.instance.slug,
data: data
patchedLDAPSourceRequest: data
});
} else {
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapCreate({
data: data
lDAPSourceRequest: data as unknown as LDAPSourceRequest
});
}
};
@ -117,7 +117,7 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
?required=${true}
?writeOnly=${this.instance !== undefined}
name="bindPassword">
<input type="text" value="${ifDefined(this.instance?.bindPassword)}" class="pf-c-form-control" required>
<input type="text" value="" class="pf-c-form-control" required>
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${t`Base DN`}

View file

@ -161,7 +161,7 @@ export class LDAPSourceViewPage extends LitElement {
.apiRequest=${() => {
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapPartialUpdate({
slug: this.source?.slug || "",
data: this.source,
patchedLDAPSourceRequest: this.source,
});
}}>
${t`Retry Task`}

View file

@ -1,4 +1,4 @@
import { OAuthSource, SourcesApi, FlowsApi, FlowDesignationEnum, UserMatchingModeEnum } from "authentik-api";
import { OAuthSource, SourcesApi, FlowsApi, FlowDesignationEnum, UserMatchingModeEnum, OAuthSourceRequest } from "authentik-api";
import { t } from "@lingui/macro";
import { customElement, property } from "lit-element";
import { html, TemplateResult } from "lit-html";
@ -44,11 +44,11 @@ export class OAuthSourceForm extends ModelForm<OAuthSource, string> {
if (this.instance) {
return new SourcesApi(DEFAULT_CONFIG).sourcesOauthPartialUpdate({
slug: this.instance.slug,
data: data
patchedOAuthSourceRequest: data
});
} else {
return new SourcesApi(DEFAULT_CONFIG).sourcesOauthCreate({
data: data
oAuthSourceRequest: data as unknown as OAuthSourceRequest
});
}
};
@ -173,7 +173,7 @@ export class OAuthSourceForm extends ModelForm<OAuthSource, string> {
?required=${true}
?writeOnly=${this.instance !== undefined}
name="consumerSecret">
<input type="text" value="${ifDefined(this.instance?.consumerSecret)}" class="pf-c-form-control" required>
<input type="text" value="" class="pf-c-form-control" required>
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${t`Provider type`}

View file

@ -50,11 +50,11 @@ export class PlexSourceForm extends ModelForm<PlexSource, string> {
if (this.instance?.slug) {
return new SourcesApi(DEFAULT_CONFIG).sourcesPlexUpdate({
slug: this.instance.slug,
data: data
plexSourceRequest: data
});
} else {
return new SourcesApi(DEFAULT_CONFIG).sourcesPlexCreate({
data: data
plexSourceRequest: data
});
}
};

View file

@ -31,11 +31,11 @@ export class SAMLSourceForm extends ModelForm<SAMLSource, string> {
if (this.instance) {
return new SourcesApi(DEFAULT_CONFIG).sourcesSamlUpdate({
slug: this.instance.slug,
data: data
sAMLSourceRequest: data
});
} else {
return new SourcesApi(DEFAULT_CONFIG).sourcesSamlCreate({
data: data
sAMLSourceRequest: data
});
}
};

View file

@ -121,7 +121,7 @@ export class StageListPage extends TablePage<Stage> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button>
<ul class="pf-c-dropdown__menu" hidden>
${until(new StagesApi(DEFAULT_CONFIG).stagesAllTypes().then((types) => {
${until(new StagesApi(DEFAULT_CONFIG).stagesAllTypesList().then((types) => {
return types.map((type) => {
return html`<li>
<ak-forms-modal>

View file

@ -31,11 +31,11 @@ export class AuthenticatorStaticStageForm extends ModelForm<AuthenticatorStaticS
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorStaticUpdate({
stageUuid: this.instance.pk || "",
data: data
authenticatorStaticStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesUserWriteCreate({
data: data
authenticatorStaticStageRequest: data
});
}
};

View file

@ -30,11 +30,11 @@ export class AuthenticatorTOTPStageForm extends ModelForm<AuthenticatorTOTPStage
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorTotpUpdate({
stageUuid: this.instance.pk || "",
data: data
authenticatorTOTPStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorTotpCreate({
data: data
authenticatorTOTPStageRequest: data
});
}
};

View file

@ -36,11 +36,11 @@ export class AuthenticatorValidateStageForm extends ModelForm<AuthenticatorValid
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateUpdate({
stageUuid: this.instance.pk || "",
data: data
authenticatorValidateStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateCreate({
data: data
authenticatorValidateStageRequest: data
});
}
};

View file

@ -28,11 +28,11 @@ export class AuthenticateWebAuthnStageForm extends ModelForm<AuthenticateWebAuth
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorWebauthnUpdate({
stageUuid: this.instance.pk || "",
data: data
authenticateWebAuthnStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorWebauthnCreate({
data: data
authenticateWebAuthnStageRequest: data
});
}
};

View file

@ -1,4 +1,4 @@
import { CaptchaStage, StagesApi } from "authentik-api";
import { CaptchaStage, CaptchaStageRequest, StagesApi } from "authentik-api";
import { t } from "@lingui/macro";
import { customElement } from "lit-element";
import { html, TemplateResult } from "lit-html";
@ -29,11 +29,11 @@ export class CaptchaStageForm extends ModelForm<CaptchaStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesCaptchaPartialUpdate({
stageUuid: this.instance.pk || "",
data: data
patchedCaptchaStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesCaptchaCreate({
data: data
captchaStageRequest: data as unknown as CaptchaStageRequest
});
}
};

View file

@ -35,11 +35,11 @@ export class ConsentStageForm extends ModelForm<ConsentStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesConsentUpdate({
stageUuid: this.instance.pk || "",
data: data
consentStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesConsentCreate({
data: data
consentStageRequest: data
});
}
};

View file

@ -28,11 +28,11 @@ export class DenyStageForm extends ModelForm<DenyStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesDenyUpdate({
stageUuid: this.instance.pk || "",
data: data
denyStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesDenyCreate({
data: data
denyStageRequest: data
});
}
};

View file

@ -28,11 +28,11 @@ export class DummyStageForm extends ModelForm<DummyStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesDummyUpdate({
stageUuid: this.instance.pk || "",
data: data
dummyStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesDummyCreate({
data: data
dummyStageRequest: data
});
}
};

View file

@ -37,11 +37,11 @@ export class EmailStageForm extends ModelForm<EmailStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesEmailPartialUpdate({
stageUuid: this.instance.pk || "",
data: data
patchedEmailStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesEmailCreate({
data: data
emailStageRequest: data
});
}
};

View file

@ -31,11 +31,11 @@ export class IdentificationStageForm extends ModelForm<IdentificationStage, stri
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesIdentificationUpdate({
stageUuid: this.instance.pk || "",
data: data
identificationStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesIdentificationCreate({
data: data
identificationStageRequest: data
});
}
};

View file

@ -30,11 +30,11 @@ export class InvitationForm extends ModelForm<Invitation, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesInvitationInvitationsUpdate({
inviteUuid: this.instance.pk || "",
data: data
invitationRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesInvitationInvitationsCreate({
data: data
invitationRequest: data
});
}
};

View file

@ -30,11 +30,11 @@ export class InvitationStageForm extends ModelForm<InvitationStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesInvitationStagesUpdate({
stageUuid: this.instance.pk || "",
data: data
invitationStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesInvitationStagesCreate({
data: data
invitationStageRequest: data
});
}
};

View file

@ -31,11 +31,11 @@ export class PasswordStageForm extends ModelForm<PasswordStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesPasswordUpdate({
stageUuid: this.instance.pk || "",
data: data
passwordStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesPasswordCreate({
data: data
passwordStageRequest: data
});
}
};

View file

@ -29,11 +29,11 @@ export class PromptForm extends ModelForm<Prompt, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsUpdate({
promptUuid: this.instance.pk || "",
data: data
promptRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsCreate({
data: data
promptRequest: data
});
}
};

View file

@ -32,11 +32,11 @@ export class PromptStageForm extends ModelForm<PromptStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesPromptStagesUpdate({
stageUuid: this.instance.pk || "",
data: data
promptStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesPromptStagesCreate({
data: data
promptStageRequest: data
});
}
};

View file

@ -28,11 +28,11 @@ export class UserDeleteStageForm extends ModelForm<UserDeleteStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesUserDeleteUpdate({
stageUuid: this.instance.pk || "",
data: data
userDeleteStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesUserDeleteCreate({
data: data
userDeleteStageRequest: data
});
}
};

View file

@ -29,11 +29,11 @@ export class UserLoginStageForm extends ModelForm<UserLoginStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesUserLoginUpdate({
stageUuid: this.instance.pk || "",
data: data
userLoginStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesUserLoginCreate({
data: data
userLoginStageRequest: data
});
}
};

View file

@ -28,11 +28,11 @@ export class UserLogoutStageForm extends ModelForm<UserLogoutStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesUserLogoutUpdate({
stageUuid: this.instance.pk || "",
data: data
userLogoutStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesUserLogoutCreate({
data: data
userLogoutStageRequest: data
});
}
};

View file

@ -28,11 +28,11 @@ export class UserWriteStageForm extends ModelForm<UserWriteStage, string> {
if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesUserWriteUpdate({
stageUuid: this.instance.pk || "",
data: data
userWriteStageRequest: data
});
} else {
return new StagesApi(DEFAULT_CONFIG).stagesUserWriteCreate({
data: data
userWriteStageRequest: data
});
}
};

View file

@ -49,7 +49,7 @@ export class UserDetailsPage extends LitElement {
.send=${(data: unknown) => {
return new CoreApi(DEFAULT_CONFIG).coreUsersUpdate({
id: this.user?.pk || 0,
data: data as User
userRequest: data as User
});
}}>
<form class="pf-c-form pf-m-horizontal">

View file

@ -78,14 +78,14 @@ export class UserSettingsPage extends LitElement {
<section slot="page-tokens" data-tab-title="${t`Tokens`}" class="pf-c-page__main-section pf-m-no-padding-mobile">
<ak-user-token-list></ak-user-token-list>
</section>
${until(new StagesApi(DEFAULT_CONFIG).stagesAllUserSettings().then((stages) => {
${until(new StagesApi(DEFAULT_CONFIG).stagesAllUserSettingsList().then((stages) => {
return stages.map((stage) => {
return html`<section slot="page-${stage.objectUid}" data-tab-title="${ifDefined(stage.title)}" class="pf-c-page__main-section pf-m-no-padding-mobile">
${this.renderStageSettings(stage)}
</section>`;
});
}))}
${until(new SourcesApi(DEFAULT_CONFIG).sourcesAllUserSettings().then((source) => {
${until(new SourcesApi(DEFAULT_CONFIG).sourcesAllUserSettingsList().then((source) => {
return source.map((stage) => {
return html`<section slot="page-${stage.objectUid}" data-tab-title="${ifDefined(stage.title)}" class="pf-c-page__main-section pf-m-no-padding-mobile">
${this.renderSourceSettings(stage)}

View file

@ -53,7 +53,7 @@ export class UserSettingsAuthenticatorWebAuthn extends BaseUserSettings {
.send=${(data: unknown) => {
return new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsWebauthnUpdate({
id: device.pk || 0,
data: data as WebAuthnDevice
webAuthnDeviceRequest: data as WebAuthnDevice
});
}}>
<form class="pf-c-form pf-m-horizontal">

View file

@ -28,11 +28,11 @@ export class UserTokenForm extends ModelForm<Token, string> {
if (this.instance) {
return new CoreApi(DEFAULT_CONFIG).coreTokensUpdate({
identifier: this.instance.identifier,
data: data
tokenRequest: data
});
} else {
return new CoreApi(DEFAULT_CONFIG).coreTokensCreate({
data: data
tokenRequest: data
});
}
};