chore: refactor to set memberOf or member as null

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-05-06 11:46:53 +02:00
committed by Fredrik Adelöw
parent 2c0dd741e9
commit e527d46998
3 changed files with 22 additions and 136 deletions
+16 -125
View File
@@ -93,17 +93,6 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the memberOf attribute on the users to power the relations of users and groups
*
* @default false
*/
skipMemberOf?: boolean;
};
/**
* JSON paths (on a.b.c form) and hard coded values to set on those
* paths.
@@ -152,7 +141,7 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.memberOf field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
};
}
| Array<{
@@ -184,17 +173,6 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the memberOf attribute on the users to power the relations of users and groups
*
* @default false
*/
skipMemberOf?: boolean;
};
/**
* JSON paths (on a.b.c form) and hard coded values to set on those
* paths.
@@ -243,7 +221,7 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.memberOf field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
};
}>;
@@ -280,17 +258,6 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the member attributes on the groups to power the relations of users and groups
*
* @default false
*/
skipMembers?: boolean;
};
/**
* JSON paths (on a.b.c form) and hard coded values to set on those
* paths.
@@ -344,12 +311,12 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.parent field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
/**
* The name of the attribute that shall be used for the values of
* the spec.children field of the entity. Defaults to "member".
*/
members?: string;
members?: string | null;
};
}
| Array<{
@@ -381,17 +348,6 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the member attributes on the groups to power the relations of users and groups
*
* @default false
*/
skipMembers?: boolean;
};
/**
* JSON paths (on a.b.c form) and hard coded values to set on those
* paths.
@@ -445,12 +401,12 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.parent field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
/**
* The name of the attribute that shall be used for the values of
* the spec.children field of the entity. Defaults to "member".
*/
members?: string;
members?: string | null;
};
}>;
/**
@@ -552,17 +508,6 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the memberOf attribute on the users to power the relations of users and groups
*
* @default false
*/
skipMemberOf?: boolean;
};
/**
* JSON paths (on a.b.c form) and hard coded values to set on those
* paths.
@@ -611,7 +556,7 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.memberOf field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
};
}
| Array<{
@@ -643,17 +588,7 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the memberOf attribute on the users to power the relations of users and groups
*
* @default false
*/
skipMemberOf?: boolean;
};
/**
* JSON paths (on a.b.c form) and hard coded values to set on those
* paths.
@@ -702,7 +637,7 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.memberOf field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
};
}>;
@@ -739,17 +674,6 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the member attributes on the groups to power the relations of users and groups
*
* @default false
*/
skipMembers?: boolean;
};
/**
* JSON paths (on a.b.c form) and hard coded values to set on those
* paths.
@@ -803,12 +727,12 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.parent field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
/**
* The name of the attribute that shall be used for the values of
* the spec.children field of the entity. Defaults to "member".
*/
members?: string;
members?: string | null;
};
}
| Array<{
@@ -840,17 +764,6 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the member attributes on the groups to power the relations of users and groups
*
* @default false
*/
skipMembers?: boolean;
};
/**
* JSON paths (on a.b.c form) and hard coded values to set on those
* paths.
@@ -904,12 +817,12 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.parent field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
/**
* The name of the attribute that shall be used for the values of
* the spec.children field of the entity. Defaults to "member".
*/
members?: string;
members?: string | null;
};
}>;
@@ -1009,17 +922,6 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the memberOf attribute on the users to power the relations of users and groups
*
* @default false
*/
skipMemberOf?: boolean;
};
/**
* JSON paths (on a.b.c form) and hard coded values to set on those
* paths.
@@ -1067,7 +969,7 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.memberOf field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
};
};
@@ -1103,17 +1005,6 @@ export interface Config {
pagePause?: boolean;
};
};
/**
* Additional parsing config
*/
parsing?: {
/**
* Whether to skip the member attributes on the groups to power the relations of users and groups
*
* @default false
*/
skipMembers?: boolean;
};
/**
* @default false
* JSON paths (on a.b.c form) and hard coded values to set on those
@@ -1168,12 +1059,12 @@ export interface Config {
* The name of the attribute that shall be used for the values of
* the spec.parent field of the entity. Defaults to "memberOf".
*/
memberOf?: string;
memberOf?: string | null;
/**
* The name of the attribute that shall be used for the values of
* the spec.children field of the entity. Defaults to "member".
*/
members?: string;
members?: string | null;
};
};
/**
@@ -120,7 +120,7 @@ export type UserConfig = {
picture?: string;
// The name of the attribute that shall be used for the values of the
// spec.memberOf field of the entity. Defaults to "memberOf".
memberOf: string;
memberOf: string | null;
};
};
@@ -168,10 +168,10 @@ export type GroupConfig = {
picture?: string;
// The name of the attribute that shall be used for the values of the
// spec.parent field of the entity. Defaults to "memberOf".
memberOf: string;
memberOf: string | null;
// The name of the attribute that shall be used for the values of the
// spec.children field of the entity. Defaults to "member".
members: string;
members: string | null;
};
};
@@ -235,9 +235,7 @@ describe('readLdapUsers', () => {
{
dn: 'ddd',
options: {},
parsing: {
skipMemberOf: true,
},
map: {
rdn: 'uid',
name: 'uid',
@@ -245,7 +243,7 @@ describe('readLdapUsers', () => {
displayName: 'cn',
email: 'mail',
picture: 'avatarUrl',
memberOf: 'memberOf',
memberOf: null,
},
},
];
@@ -799,9 +797,6 @@ describe('readLdapGroups', () => {
{
dn: 'ddd',
options: {},
parsing: {
skipMembers: true,
},
map: {
rdn: 'cn',
name: 'cn',
@@ -811,7 +806,7 @@ describe('readLdapGroups', () => {
picture: 'avatarUrl',
type: 'tt',
memberOf: 'memberOf',
members: 'member',
members: null,
},
},
];