/** * Create an instance of {@link PasswordCredentialsPolicyType } * */ public PasswordCredentialsPolicyType createPasswordCredentialsPolicyType() { return new PasswordCredentialsPolicyType(); }
private void postProcessPasswordCredentialPolicy(SecurityPolicyType securityPolicyType, PasswordCredentialsPolicyType passwd, Task task, OperationResult result) { // Deprecated settings Integer passwordHistoryLength = passwd.getPasswordHistoryLength(); if (passwordHistoryLength != null && passwd.getHistoryLength() == null) { passwd.setHistoryLength(passwordHistoryLength); } ObjectReferenceType passwordPolicyRef = passwd.getPasswordPolicyRef(); if (passwordPolicyRef != null && passwd.getValuePolicyRef() == null) { passwd.setValuePolicyRef(passwordPolicyRef.clone()); } ValuePolicyType valuePolicyType = postProcessCredentialPolicy(securityPolicyType, passwd, "password credential policy", task, result); if (valuePolicyType != null) { setDeprecatedPasswordPolicyProperties(valuePolicyType, passwd); } }
public PasswordCredentialsPolicyType maxAge(Duration value) { setMaxAge(value); return this; }
public PasswordCredentialsPolicyType clone() { PasswordCredentialsPolicyType object = new PasswordCredentialsPolicyType(); PrismContainerValue value = asPrismContainerValue().clone(); object.setupContainerValue(value); return object; }
private void setDeprecatedPasswordPolicyProperties(ValuePolicyType passwordPolicyType, PasswordCredentialsPolicyType passwd) { PasswordLifeTimeType lifetime = passwordPolicyType.getLifetime(); if (lifetime != null) { Integer expiration = lifetime.getExpiration(); if (expiration != null && expiration != 0 && passwd.getMaxAge() == null) { passwd.setMaxAge(daysToDuration(expiration)); } Integer minPasswordAge = lifetime.getMinPasswordAge(); if (minPasswordAge != null && minPasswordAge != 0 && passwd.getMinAge() == null) { passwd.setMinAge(daysToDuration(minPasswordAge)); } Integer passwordHistoryLength = lifetime.getPasswordHistoryLength(); if (passwordHistoryLength != null && passwd.getHistoryLength() == null) { passwd.setHistoryLength(passwordHistoryLength); } } String minOccurs = passwordPolicyType.getMinOccurs(); if (minOccurs != null && passwd.getMinOccurs() == null) { passwd.setMinOccurs(minOccurs); } }
private SecurityPolicyType postProcessPasswordPolicy(ValuePolicyType passwordPolicyType) { SecurityPolicyType securityPolicyType = new SecurityPolicyType(); CredentialsPolicyType creds = new CredentialsPolicyType(); PasswordCredentialsPolicyType passwd = new PasswordCredentialsPolicyType(); ObjectReferenceType passwordPolicyRef = new ObjectReferenceType(); passwordPolicyRef.asReferenceValue().setObject(passwordPolicyType.asPrismObject()); passwd.setValuePolicyRef(passwordPolicyRef); creds.setPassword(passwd); securityPolicyType.setCredentials(creds); setDeprecatedPasswordPolicyProperties(passwordPolicyType, passwd); return securityPolicyType; }
public static PasswordCredentialsPolicyType getEffectivePasswordCredentialsPolicy(SecurityPolicyType securityPolicy) { if (securityPolicy == null) { return null; } CredentialsPolicyType creds = securityPolicy.getCredentials(); if (creds == null) { return null; } if (creds.getDefault() == null) { return creds.getPassword(); } PasswordCredentialsPolicyType passPolicy = creds.getPassword(); if (passPolicy == null) { passPolicy = new PasswordCredentialsPolicyType(); } else { passPolicy = passPolicy.clone(); } copyDefaults(creds.getDefault(), passPolicy); return passPolicy; }
private boolean containsValuePolicyDefinition(CredentialsPolicyType policy) { if (policy == null) { return false; } if (policy.getPassword() == null) { return false; } if (policy.getPassword().getValuePolicyRef() != null) { return true; } if (policy.getPassword().getPasswordPolicyRef() != null) { return true; } return false; }
public ObjectReferenceType beginValuePolicyRef() { ObjectReferenceType value = new ObjectReferenceType(); valuePolicyRef(value); return value; }
.beginCredentials() .beginPassword() .valuePolicyRef(PASSWORD_POLICY_GLOBAL_OID, ValuePolicyType.COMPLEX_TYPE) .historyLength(ORG_MINISTRY_OF_OFFENSE_PASSWORD_HISTORY_LENGTH); ministrySecurityPolicyOid = addObject(securityPolicy, task, result);
public PasswordCredentialsPolicyType minAge(Duration value) { setMinAge(value); return this; }
public PasswordCredentialsPolicyType minOccurs(String value) { setMinOccurs(value); return this; }
public PasswordCredentialsPolicyType valuePolicyRef(ObjectReferenceType value) { setValuePolicyRef(value); return this; }
public PasswordCredentialsPolicyType historyLength(Integer value) { setHistoryLength(value); return this; }
/** * Not very systematic. Used mostly in hacks. */ public static ValuePolicyType getPasswordPolicy(SecurityPolicyType securityPolicy) { if (securityPolicy == null) { return null; } CredentialsPolicyType creds = securityPolicy.getCredentials(); if (creds == null) { return null; } PasswordCredentialsPolicyType passd = creds.getPassword(); if (passd == null) { return null; } ObjectReferenceType valuePolicyRef = passd.getValuePolicyRef(); if (valuePolicyRef == null) { return null; } PrismObject<ValuePolicyType> policyObj = valuePolicyRef.asReferenceValue().getObject(); if (policyObj == null) { return null; } return policyObj.asObjectable(); }
if (policy.getPassword().getValuePolicyRef() != null) { return objectResolver.resolve(policy.getPassword().getValuePolicyRef(), ValuePolicyType.class, null, "valuePolicyRef in password credential policy", task, parentResult); } else if (policy.getPassword().getPasswordPolicyRef() != null) { return objectResolver.resolve(policy.getPassword().getPasswordPolicyRef(), ValuePolicyType.class, null, "valuePolicyRef in password credential policy", task, parentResult);
public PasswordCredentialsPolicyType valuePolicyRef(String oid, QName type) { PrismReferenceValue refVal = new PrismReferenceValueImpl(oid, type); ObjectReferenceType ort = new ObjectReferenceType(); ort.setupReferenceValue(refVal); return valuePolicyRef(ort); }
/** * Create an instance of {@link PasswordCredentialsPolicyType } * */ public PasswordCredentialsPolicyType createPasswordCredentialsPolicyType() { return new PasswordCredentialsPolicyType(); }
public PasswordCredentialsPolicyType valuePolicyRef(String oid, QName type, QName relation) { PrismReferenceValue refVal = new PrismReferenceValueImpl(oid, type); refVal.setRelation(relation); ObjectReferenceType ort = new ObjectReferenceType(); ort.setupReferenceValue(refVal); return valuePolicyRef(ort); }
/** * Create an instance of {@link PasswordCredentialsPolicyType } * */ public PasswordCredentialsPolicyType createPasswordCredentialsPolicyType() { return new PasswordCredentialsPolicyType(); }