Skip to content

Commit 1ceaddb

Browse files
committed
fix: improve pacc compability
BREAKING CHANGE: configurationAttributes->attributes
1 parent f1602a7 commit 1ceaddb

File tree

2 files changed

+45
-46
lines changed

2 files changed

+45
-46
lines changed

package-lock.json

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/service-ldap.mjs

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { Client, Change, Attribute } from "ldapts";
2-
import { prepareAttributesDefinitions, mergeAttributeDefinitions } from "pacc";
2+
import {
3+
prepareAttributesDefinitions,
4+
mergeAttributeDefinitions,
5+
url_attribute,
6+
default_attribute
7+
} from "pacc";
38
import { Service } from "@kronos-integration/service";
49
import { expand } from "./util.mjs";
510

@@ -18,32 +23,26 @@ export class ServiceLDAP extends Service {
1823
return "LDAP server access for bind/add/modify/del/query";
1924
}
2025

21-
static get configurationAttributes() {
22-
return mergeAttributeDefinitions(
23-
prepareAttributesDefinitions({
24-
url: {
25-
needsRestart: true,
26-
mandatory: true,
27-
type: "url"
28-
},
29-
entitlements: {
30-
description: "attributes to build a entitlement query",
31-
attributes: {
32-
bindDN: {
33-
type: "string"
34-
},
35-
base: {
36-
type: "string"
37-
},
38-
attribute: { default: "cn", type: "string" },
39-
scope: { default: "sub", type: "string" },
40-
filter: { type: "string" }
41-
}
26+
static attributes = mergeAttributeDefinitions(
27+
prepareAttributesDefinitions({
28+
url: {
29+
...url_attribute,
30+
needsRestart: true,
31+
mandatory: true
32+
},
33+
entitlements: {
34+
description: "attributes to build a entitlement query",
35+
attributes: {
36+
bindDN: default_attribute,
37+
base: default_attribute,
38+
attribute: { ...default_attribute, default: "cn" },
39+
scope: { ...default_attribute, default: "sub" },
40+
filter: default_attribute
4241
}
43-
}),
44-
Service.configurationAttributes
45-
);
46-
}
42+
}
43+
}),
44+
Service.attributes
45+
);
4746

4847
static get endpoints() {
4948
return {

0 commit comments

Comments
 (0)