feat(bff): GET/PUT /beheer/default-fill proxying the ACL for beheerders (refs #131)

This commit is contained in:
not
2026-07-24 15:40:59 +02:00
parent e5572efdb6
commit 0c420738ef
3 changed files with 160 additions and 0 deletions
@@ -24,6 +24,12 @@ import {
Observable Observable
} from 'rxjs'; } from 'rxjs';
export interface BeheerDefaultFill {
bronorganisatie: string;
verantwoordelijkeOrganisatie: string;
vertrouwelijkheidaanduiding: string;
}
export interface BeheerZaaktype { export interface BeheerZaaktype {
identificatie: string; identificatie: string;
omschrijving: string; omschrijving: string;
@@ -446,4 +452,69 @@ export class BffApiV1Service {
); );
} }
getBeheerDefaultFill<TData = BeheerDefaultFill>( options?: HttpClientBodyOptions): Observable<TData>;
getBeheerDefaultFill<TData = BeheerDefaultFill>( options?: HttpClientEventOptions): Observable<HttpEvent<TData>>;
getBeheerDefaultFill<TData = BeheerDefaultFill>( options?: HttpClientResponseOptions): Observable<AngularHttpResponse<TData>>;
getBeheerDefaultFill<TData = BeheerDefaultFill>(
options?: HttpClientObserveOptions): Observable<TData | HttpEvent<TData> | AngularHttpResponse<TData>> {
if (options?.observe === 'events') {
return this.http.get<TData>(
`/beheer/default-fill`,{
...(options as Omit<NonNullable<typeof options>, 'observe'>),
observe: 'events',
}
);
}
if (options?.observe === 'response') {
return this.http.get<TData>(
`/beheer/default-fill`,{
...(options as Omit<NonNullable<typeof options>, 'observe'>),
observe: 'response',
}
);
}
return this.http.get<TData>(
`/beheer/default-fill`,{
...(options as Omit<NonNullable<typeof options>, 'observe'>),
observe: 'body',
}
);
}
putBeheerDefaultFill<TData = void>(beheerDefaultFill: BeheerDefaultFill, options?: HttpClientBodyOptions): Observable<TData>;
putBeheerDefaultFill<TData = void>(beheerDefaultFill: BeheerDefaultFill, options?: HttpClientEventOptions): Observable<HttpEvent<TData>>;
putBeheerDefaultFill<TData = void>(beheerDefaultFill: BeheerDefaultFill, options?: HttpClientResponseOptions): Observable<AngularHttpResponse<TData>>;
putBeheerDefaultFill<TData = void>(
beheerDefaultFill: BeheerDefaultFill, options?: HttpClientObserveOptions): Observable<TData | HttpEvent<TData> | AngularHttpResponse<TData>> {
if (options?.observe === 'events') {
return this.http.put<TData>(
`/beheer/default-fill`,
beheerDefaultFill,{
...(options as Omit<NonNullable<typeof options>, 'observe'>),
observe: 'events',
}
);
}
if (options?.observe === 'response') {
return this.http.put<TData>(
`/beheer/default-fill`,
beheerDefaultFill,{
...(options as Omit<NonNullable<typeof options>, 'observe'>),
observe: 'response',
}
);
}
return this.http.put<TData>(
`/beheer/default-fill`,
beheerDefaultFill,{
...(options as Omit<NonNullable<typeof options>, 'observe'>),
observe: 'body',
}
);
}
}; };
+19
View File
@@ -228,6 +228,25 @@ app.MapGet("/beheer/catalogi/zaaktypen", async (IAclClient acl, CancellationToke
.Produces(StatusCodes.Status401Unauthorized) .Produces(StatusCodes.Status401Unauthorized)
.Produces(StatusCodes.Status403Forbidden); .Produces(StatusCodes.Status403Forbidden);
// Beheer default-fill config (S-15b): read + edit the ACL's default-fill values. Behind medewerker-
// realm + beheerder authorization; the BFF proxies the ACL (ADR-0025). The ACL validates the values.
app.MapGet("/beheer/default-fill", async (IAclClient acl, CancellationToken ct) =>
Results.Ok(await acl.GetDefaultFillAsync(ct)))
.RequireAuthorization(BeheerAuth.Policy)
.Produces<BeheerDefaultFill>(StatusCodes.Status200OK)
.Produces(StatusCodes.Status401Unauthorized)
.Produces(StatusCodes.Status403Forbidden);
app.MapPut("/beheer/default-fill", async (BeheerDefaultFill body, IAclClient acl, CancellationToken ct) =>
{
await acl.UpdateDefaultFillAsync(body, ct);
return Results.NoContent();
})
.RequireAuthorization(BeheerAuth.Policy)
.Produces(StatusCodes.Status204NoContent)
.Produces(StatusCodes.Status401Unauthorized)
.Produces(StatusCodes.Status403Forbidden);
app.Run(); app.Run();
/// <summary>The behandelaar's decision on a registration.</summary> /// <summary>The behandelaar's decision on a registration.</summary>
+70
View File
@@ -255,10 +255,80 @@
} }
} }
} }
},
"/beheer/default-fill": {
"get": {
"tags": [
"Bff.Api"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BeheerDefaultFill"
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
}
},
"put": {
"tags": [
"Bff.Api"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BeheerDefaultFill"
}
}
},
"required": true
},
"responses": {
"204": {
"description": "No Content"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
}
}
} }
}, },
"components": { "components": {
"schemas": { "schemas": {
"BeheerDefaultFill": {
"required": [
"bronorganisatie",
"verantwoordelijkeOrganisatie",
"vertrouwelijkheidaanduiding"
],
"type": "object",
"properties": {
"bronorganisatie": {
"type": "string"
},
"verantwoordelijkeOrganisatie": {
"type": "string"
},
"vertrouwelijkheidaanduiding": {
"type": "string"
}
}
},
"BeheerZaaktype": { "BeheerZaaktype": {
"required": [ "required": [
"identificatie", "identificatie",