protected void testUpdate(IdentityBackend backend) throws KrbException { KrbIdentity kid = BackendTestUtil.createOneIdentity(TEST_PRINCIPAL); backend.addIdentity(kid); kid.setDisabled(true); backend.updateIdentity(kid); // clear the identity cache. backend.release(); assertThat(backend.getIdentity(TEST_PRINCIPAL)).isEqualTo(kid); //tearDown backend.deleteIdentity(TEST_PRINCIPAL); }
protected void testUpdate(IdentityBackend backend) throws KrbException { KrbIdentity kid = BackendTestUtil.createOneIdentity(TEST_PRINCIPAL); backend.addIdentity(kid); kid.setDisabled(true); backend.updateIdentity(kid); // clear the identity cache. backend.release(); assertThat(backend.getIdentity(TEST_PRINCIPAL)).isEqualTo(kid); //tearDown backend.deleteIdentity(TEST_PRINCIPAL); }
@Override public void modifyPrincipal(String principal, KOptions kOptions) throws KrbException { principal = fixPrincipal(principal); KrbIdentity identity = backend.getIdentity(principal); if (identity == null) { throw new KrbException("Principal \"" + principal + "\" does not exist."); } AdminHelper.updateIdentity(identity, kOptions); backend.updateIdentity(identity); }
@Override public void modifyPrincipal(String principal, KOptions kOptions) throws KrbException { principal = fixPrincipal(principal); KrbIdentity identity = backend.getIdentity(principal); if (identity == null) { throw new KrbException("Principal \"" + principal + "\" does not exist."); } AdminHelper.updateIdentity(identity, kOptions); backend.updateIdentity(identity); }
@Override public void updateKeys(String principal) throws KrbException { principal = fixPrincipal(principal); KrbIdentity identity = backend.getIdentity(principal); if (identity == null) { throw new KrbException("Principal " + principal + "was not found. Please check the input and try again"); } List<EncryptionKey> keys = EncryptionUtil.generateKeys( getKdcConfig().getEncryptionTypes()); identity.addKeys(keys); backend.updateIdentity(identity); }
@Override public void changePassword(String principal, String newPassword) throws KrbException { principal = fixPrincipal(principal); KrbIdentity identity = backend.getIdentity(principal); if (identity == null) { throw new KrbException("Principal " + principal + " was not found. Please check the input and try again"); } List<EncryptionKey> keys = EncryptionUtil.generateKeys(principal, newPassword, getKdcConfig().getEncryptionTypes()); identity.addKeys(keys); backend.updateIdentity(identity); }
@Override public void updateKeys(String principal) throws KrbException { principal = fixPrincipal(principal); KrbIdentity identity = backend.getIdentity(principal); if (identity == null) { throw new KrbException("Principal " + principal + "was not found. Please check the input and try again"); } List<EncryptionKey> keys = EncryptionUtil.generateKeys( getKdcConfig().getEncryptionTypes()); identity.addKeys(keys); backend.updateIdentity(identity); }
@Override public void changePassword(String principal, String newPassword) throws KrbException { principal = fixPrincipal(principal); KrbIdentity identity = backend.getIdentity(principal); if (identity == null) { throw new KrbException("Principal " + principal + " was not found. Please check the input and try again"); } List<EncryptionKey> keys = EncryptionUtil.generateKeys(principal, newPassword, getKdcConfig().getEncryptionTypes()); identity.addKeys(keys); backend.updateIdentity(identity); }