Class DSACreationTemplate
Note that all DNs in this class should be passed through relocateDN(com.isode.dsapi.DN)
before use, in case DN relocations have been
specified. DN-relocations can be used to change the location of
whole subtrees and also to change DNs of configured users or to
rename them, e.g. managers and so on. The data in the LDIF and
also the GAC is relocated accordingly.
- Since:
- 15.0
- Author:
- jp
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Admin point information.static class
DN parameter for template.static enum
Type of DSA to be created.class
Class representing a request for an index to be created in all the GDAMs of the new DSA.static class
Mandatory groupstatic class
Naming context GDAM overrides.static class
Optional groupstatic class
Optional rulestatic class
Limit on optional rules.static enum
This enum stores the supported password hash schemes in the DSA - obtained from lib/syntax/x500/passwd.c.static class
Password parameter.static class
User bind-profile to create. -
Field Summary
FieldsModifier and TypeFieldDescriptionAdmin points specified, or empty list if none.List of attribute types for which we want indexes to be auto-created, or empty listLabel for bind profile, or null to use the value of 'label'.Naming contexts to be consumed from master (relevant on creating a shadow DSA), or empty list if none.Naming contexts specified, or empty list if none.List of entries to ensure are created, or empty list if none.DNParams for this template, or empty list if none.DSA DN, never null for DSA creation.boolean
boolean
Filename of GAC XML file to load, of null if no global access control data should be loaded.GDAM type, never null.boolean
This boolean controls whether the option of using SCRAM-SHA1 hashing of passwords should be offered to the user when creating a DSA.Password params for this template, or empty list if none.Installation path, never null for DSA creation.Label, never null for DSA creation.Filename of LDIF to load, or null if no entries need loading.DN of config user who will be put into the bind profile installed for D3M's use after creation is complete, or null if the superuser should be left active.List of mandatory groups, or empty list.Presentation address of multimaster server that will be used to perform initial population of this new one.List of optional groups for the user to select/deselect, or empty list.List of optional rule-item restrictions, or empty list.List of optional rule-items for the user to select between, or empty list.Presentation address, never null for DSA creation.What kind of password hashing to usePassword params for this template, or empty list if none.boolean
This boolean controls whether or not to set the authTimestamps attribute in the configuration entry.Authentication data between shadow and master server (relevant on creating a shadow DSA).Superuser password to install on the new DSA, or null to generate a secure temporary password on reloading.List of additional user bind profiles to create, or empty list if none. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test whether the selection in the OptRule list are valid according to the loaded list of OptRuleLimits.void
Clear the DNParam cache used by relocateDN().void
dumpXML
(com.isode.util.XMLOutput out) Dump template as XML.generatePassword
(int len) Generate a password string of randomly-selected letters and digits of the given length.getDNParam
(String labelPrefix) Find out the DNParam information for a DN inside the template with a specified label.DN[]
Return a list of source/target DN pairs in an array suitable to use to callAttribute.relocate(DN...)
generated from the DNParam list.void
Initialise the bind-profile labels from the relocated DSA DN and the manager or user RDN values.static DSACreationTemplate
loadXML
(com.isode.util.XMLInput in) Try to load up the DSACreationTemplate from XML.relocateDN
(DN dn) Relocate a DN according to the configured DNParam list, or pass through null.boolean
Switch an optional rule on or off, reversing its state.
-
Field Details
-
label
Label, never null for DSA creation. -
bp_label
Label for bind profile, or null to use the value of 'label'. This is not saved/reloaded from the XML. -
install_path
Installation path, never null for DSA creation. There must be no existing file or directory at this location. This is not saved/reloaded in the XML. -
gdam_type
GDAM type, never null. -
dsa_dn
DSA DN, never null for DSA creation. -
pa
Presentation address, never null for DSA creation. Not saved to XML. -
meshInitPA
Presentation address of multimaster server that will be used to perform initial population of this new one. Not saved to XML. -
manager_dn
DN of config user who will be put into the bind profile installed for D3M's use after creation is complete, or null if the superuser should be left active. If specified, then this should be one of the config users set up by the LDIF and GAC XML. It should also appear in the PWParam list, so that a password is generated or assigned to it. -
superuser_password
Superuser password to install on the new DSA, or null to generate a secure temporary password on reloading. If this is specified and the superuser is left active after the DSA creation is complete, then this is the password that will remain active for the superuser. If the superuser is not left active, then specifying the password here is pointless as it will be deleted from the DSA. -
hideScramSha1
public boolean hideScramSha1This boolean controls whether the option of using SCRAM-SHA1 hashing of passwords should be offered to the user when creating a DSA. Hashing should not be selected for DSAs which are going to be used to hold messaging configurations (because various components of the messaging system will need to be able to read plain-text password values). Note that when we don't allow SCRAM-SHA-1 we also don't allow SCRAM-SHA-256.- Since:
- R16.0
-
enableScramSha1
public boolean enableScramSha1 -
enableScramSha256
public boolean enableScramSha256 -
recordAuthTimestamps
public boolean recordAuthTimestampsThis boolean controls whether or not to set the authTimestamps attribute in the configuration entry.- Since:
- R16.6
-
passwordHash
What kind of password hashing to use -
dsaType
-
ap_list
Admin points specified, or empty list if none. -
cp_list
Naming contexts specified, or empty list if none. -
consumedNClist
Naming contexts to be consumed from master (relevant on creating a shadow DSA), or empty list if none. -
shadowAuthData
Authentication data between shadow and master server (relevant on creating a shadow DSA). -
create_list
List of entries to ensure are created, or empty list if none. -
userbp_list
List of additional user bind profiles to create, or empty list if none. -
opt_rule_list
List of optional rule-items for the user to select between, or empty list. Deselected rule-items are deleted from the GAC before being applied. -
opt_rule_limits
List of optional rule-item restrictions, or empty list. -
opt_group_list
List of optional groups for the user to select/deselect, or empty list. Deselected groups are deleted from the GAC before being applied. -
mand_group_list
List of mandatory groups, or empty list. -
attrs_to_index
List of attribute types for which we want indexes to be auto-created, or empty list -
ldif_file
Filename of LDIF to load, or null if no entries need loading. If this filename is saved in the XML, then it is assumed that this file will be stored alongside the config XML file, so only the name not the full path is stored. -
gac_file
Filename of GAC XML file to load, of null if no global access control data should be loaded. If this filename is saved in the XML, then it is assumed that this file will be stored alongside the config XML file, so only the name not the full path is stored. -
dnparams
DNParams for this template, or empty list if none. The parameters are substituted as if in parallel, with longer matches overriding shorter matches. -
pwparams
Password params for this template, or empty list if none. These are used to substitute the default passwords in the LDIF with actual live passwords. These passwords may be auto-generated ones, or ones written into these PWParam instances by the caller.TODO: Allow PWParams that configure strong binds as well, outputting a list of .P12 files with passwords to be distributed to the users.
-
hpwparams
Password params for this template, or empty list if none. These are used to SILENTLY substitute default passwords in the LDIF with actual live passwords WITHOUT displaying them via the DSA creation GUI or command line interface. These passwords are auto-generated only.
-
-
Constructor Details
-
DSACreationTemplate
public DSACreationTemplate()
-
-
Method Details
-
dumpXML
Dump template as XML.- Throws:
IOException
-
loadXML
Try to load up the DSACreationTemplate from XML. Returns null if not found.- Parameters:
in
- XMLInput to read
-
generatePassword
Generate a password string of randomly-selected letters and digits of the given length. Uses a SecureRandom instance as a source.- Parameters:
len
- Length of password required- Returns:
- Password string.
-
clearRelocateDNCache
public void clearRelocateDNCache()Clear the DNParam cache used by relocateDN(). -
getRelocationDNPairArray
Return a list of source/target DN pairs in an array suitable to use to callAttribute.relocate(DN...)
generated from the DNParam list.- Returns:
- DN[]
-
relocateDN
Relocate a DN according to the configured DNParam list, or pass through null. Note that a cached copy of 'dnparams' is created and used. If changes are made to 'dnparams' and relocateDN() is called again, then the cache must be cleared first by callingclearRelocateDNCache()
. -
areOptRulesValid
public boolean areOptRulesValid()Test whether the selection in the OptRule list are valid according to the loaded list of OptRuleLimits.- Returns:
- true: rule selections are valid, false: otherwise
-
switchOptRule
Switch an optional rule on or off, reversing its state. If switching it off would cause an invalid state due to a at-least-one limit, then nothing is done. If switching it on would cause an invalid state due to an at-most-one limit, then all the other rules in the group are turned off.Note that it is possible to create a set of limits that mean that it is impossible for this routine to leave the selections in a valid state. It makes no attempt to solve things in that case.
- Parameters:
or
- OptRule to switch on/off- Returns:
- true: a change was made, false: no change was possible
-
initBPLabels
public void initBPLabels()Initialise the bind-profile labels from the relocated DSA DN and the manager or user RDN values. This should be called after all relocations have been configured, or else the values inserted will be out of date by the time the DSA is created. -
getDNParam
Find out the DNParam information for a DN inside the template with a specified label. This may be useful for a caller who wishes to find out, after the DSA creation completes, where a given DN ended up being relocated to.Note that the caller only needs to specify the initial part of the label; this is because labels in the template can be very long and contain descriptive text, and typically just the first part of the label is sufficient to identify the DN in question.
- Parameters:
labelPrefix
- the label, or beginning of the label for the DN inside the template. Must not be null.- Returns:
- the first DNParam that has a label matching, or starting with, label, or null if there is no matching DN in the template.
- Since:
- 15.2
-