Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve forceUpdateCredential and resolver by name (for midPoint 4.4) #64

Merged
merged 4 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -856,10 +856,15 @@ protected void updateCredential(MidPointTaskContext ctx, String oldCred, String
final ObjectDelta<UserType> objectDelta = prismContext.deltaFactory().object().createModifyDelta(userOid, delta, UserType.class);

// delta for nonce
NonceType nonce = user.getCredentials().getNonce();
if (clearNonce && nonce != null) {
objectDelta.addModificationDeleteContainer(ItemPath.create(UserType.F_CREDENTIALS, CredentialsType.F_NONCE),
nonce.clone());
if (clearNonce) {
CredentialsType credentials = user.getCredentials();
if (credentials != null) {
NonceType nonce = credentials.getNonce();
if (nonce != null) {
objectDelta.addModificationDeleteContainer(ItemPath.create(UserType.F_CREDENTIALS, CredentialsType.F_NONCE),
nonce.clone());
}
}
}

// delta for lifecycleState
Expand Down Expand Up @@ -993,7 +998,7 @@ public void getRole(GetRoleRequest request, StreamObserver<GetRoleResponse> resp

OperationResult parentResult = task.getResult().createSubresult(OPERATION_GET_ROLE);

String oid = resolveOid(UserType.class, request.getOid(), request.getName(), task, parentResult);
String oid = resolveOid(RoleType.class, request.getOid(), request.getName(), task, parentResult);

List<String> options = request.getOptionsList();
List<String> include = request.getIncludeList();
Expand Down Expand Up @@ -1070,7 +1075,7 @@ public void getOrg(GetOrgRequest request, StreamObserver<GetOrgResponse> respons

OperationResult parentResult = task.getResult().createSubresult(OPERATION_GET_ORG);

String oid = resolveOid(UserType.class, request.getOid(), request.getName(), task, parentResult);
String oid = resolveOid(OrgType.class, request.getOid(), request.getName(), task, parentResult);

List<String> options = request.getOptionsList();
List<String> include = request.getIncludeList();
Expand Down Expand Up @@ -1147,7 +1152,7 @@ public void getService(GetServiceRequest request, StreamObserver<GetServiceRespo

OperationResult parentResult = task.getResult().createSubresult(OPERATION_GET_SERVICE);

String oid = resolveOid(UserType.class, request.getOid(), request.getName(), task, parentResult);
String oid = resolveOid(ServiceType.class, request.getOid(), request.getName(), task, parentResult);

List<String> options = request.getOptionsList();
List<String> include = request.getIncludeList();
Expand Down Expand Up @@ -1729,7 +1734,7 @@ public void deleteObject(DeleteObjectRequest request, StreamObserver<DeleteObjec
clazz = ObjectTypes.getObjectTypeClass(qname);
}

String oid = resolveOid(UserType.class, request.getOid(), request.getName(), task, parentResult);
String oid = resolveOid(clazz, request.getOid(), request.getName(), task, parentResult);

List<String> options = request.getOptionsList();

Expand Down Expand Up @@ -1790,7 +1795,7 @@ public void recomputeObject(RecomputeObjectRequest request, StreamObserver<Recom
throw exception;
}

String oid = resolveOid(UserType.class, request.getOid(), request.getName(), task, parentResult);
String oid = resolveOid(clazz, request.getOid(), request.getName(), task, parentResult);
ModelExecuteOptions options = ModelExecuteOptions.createReconcile();

ObjectDelta<? extends FocusType> emptyDelta = prismContext.deltaFactory().object()
Expand Down
Loading
Loading