Skip to content

Commit

Permalink
Merge pull request #1761 from jrha/indentation-openldap
Browse files Browse the repository at this point in the history
ncm-openldap: Cleanup pan templates
  • Loading branch information
jrha authored Nov 29, 2024
2 parents 2bd3f64 + 293dd9b commit ac3014d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
4 changes: 2 additions & 2 deletions ncm-openldap/src/main/pan/components/openldap/config.pan
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ unique template components/${project.artifactId}/config;

include 'components/${project.artifactId}/schema';

'/software/packages'=pkg_repl('ncm-${project.artifactId}','${no-snapshot-version}-${RELEASE}','noarch');
'/software/packages' = pkg_repl('ncm-${project.artifactId}', '${no-snapshot-version}-${RELEASE}', 'noarch');

prefix '/software/components/${project.artifactId}';
'dependencies/pre' ?= list ('spma');
'dependencies/pre' ?= list('spma');
'active' ?= true;
'dispatch' ?= true;
'version' = '${no-snapshot-version}';
33 changes: 15 additions & 18 deletions ncm-openldap/src/main/pan/components/openldap/schema.pan
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function openldap_loglevels_to_long = {
lvls = list(default);
};

total=0;
foreach(idx;lvl;lvls) {
total = 0;
foreach(idx; lvl; lvls) {
if(!exists(the_map[lvl])) {
return(undef);
};
Expand All @@ -59,31 +59,27 @@ function openldap_loglevels_to_long = {

@documentation{
power of 2 (up to 64k)
This is based on public domain code from http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
}
type long_pow2 = long with (SELF==1||SELF==2||SELF==4||SELF==8||
SELF==16||SELF==32||SELF==64||SELF==128||SELF==256||SELF==512||
SELF==1024||SELF==2048||SELF==4096||SELF==8192||SELF==16384||
SELF==32768||SELF==65536||
error("Only powers of two are accepted"));
type long_pow2 = long(1..65535) with (SELF & (SELF - 1)) == 0 || error("Only powers of two are accepted");

@documentation{
Possible acceptable values
}
type ldap_hash = string with match(SELF, '\{(S?(SHA|MD5))\}') ||
error ("Only secure hashes are accepted here: {SSHA, SHA, SMD5, MD5}");
type ldap_hash = string with match(SELF, '\{(S?(SHA|MD5))\}') || error(
"Only secure hashes are accepted here: {SSHA, SHA, SMD5, MD5}"
);

type ldap_sizelimit = {
"soft" ? long
"hard" ? long
} with exists(SELF["soft"]) || exists(SELF["hard"]) ||
error("Either 'soft' or 'hard' limits must be supplied");
} with exists(SELF["soft"]) || exists(SELF["hard"]) || error("Either 'soft' or 'hard' limits must be supplied");

type ldap_buffer_size = {
"listener" ? type_absoluteURI
"read" ? long
"write" ? long
} with exists(SELF["read"]) || exists(SELF["write"]) ||
error("Either 'read' or 'write' limits must be supplied");
} with exists(SELF["read"]) || exists(SELF["write"]) || error("Either 'read' or 'write' limits must be supplied");

type ldap_access_item = {
"who" ? string
Expand Down Expand Up @@ -181,12 +177,13 @@ type ldap_global = {
};


type ldap_database_string = string with
match(SELF, "^(bdb|config|dnssrv|hdb|ldap|ldif|meta|monitor|null|passwd|perl|relay|shell|sql)$") ||
error("Unknown LDAP database type. Check sladpd.conf man page");
type ldap_database_string = string with match(SELF,
"^(bdb|config|dnssrv|hdb|ldap|ldif|meta|monitor|null|passwd|perl|relay|shell|sql)$"
) || error("Unknown LDAP database type. Check sladpd.conf man page");

type ldap_ops = string with
match(SELF, '^(add|bind|compare|delete|modify|rename|search|read|write|(extended=\w+)|rename)$');
type ldap_ops = string with match(SELF,
'^(add|bind|compare|delete|modify|rename|search|read|write|(extended=\w+)|rename)$'
);

type ldap_replica_retries = {
"interval" : string
Expand Down

0 comments on commit ac3014d

Please sign in to comment.