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

ISPN-14144 Propagate subject in task execution #10336

Merged
merged 1 commit into from Sep 26, 2022

Conversation

tristantarrant
Copy link
Member

private Optional<Map<String, ?>> parameters = Optional.empty();
private Optional<Subject> subject = Optional.empty();
private boolean logEvent;
private transient EmbeddedCacheManager cacheManager;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the transient keyword, the class isn't Serializable and doesn't need to be.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but it is a nice way to mark the fields

@@ -30,14 +26,14 @@
@ProtoField(2)
final String cacheName;

@ProtoField(number = 3, collectionImplementation = ArrayList.class)
final List<TaskParameter> parameters;
@ProtoField(3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct way to handle this is to use a new field. Ideally we would just be able to add @ProtoReservice(value=3) to the class and proto.lock checks would pass. However, the reserved statement is currently commented due to a limitation in the protostream proto parser infinispan/protostream#174.

Adding @ProtoReservice(value=3) will still prevent the field being used in the ProtoField though.

A workaround to keep proto compatibility would be todo the following:

   @ProtoField(1)
   final String taskName;

   @ProtoField(2)
   final String cacheName;

   @ProtoField(number = 3, collectionImplementation = ArrayList.class)
   List<TaskParameter> parameters;

   @ProtoField(4)
   final TaskContext context;

   @ProtoFactory
   DistributedServerTask(String taskName, String cacheName, List<TaskParameter> parameters, TaskContext context) {
      this(taskName, cacheName, context);
   }
   
   public DistributedServerTask(String taskName, String cacheName, TaskContext context) {
      this.cacheName = cacheName;
      this.taskName = taskName;
      this.context = context;
   }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for internal invocation only, so I'm not fussed about losing backwards compat.

@ryanemerson
Copy link
Contributor

ScriptingTest and ScriptingDataStoresTest are both failing.

@tristantarrant
Copy link
Member Author

Should be fixed. The AuthorizationCertIT failures made me discover that we were adding an anonymous principal to the subject when using client cert authentication. I've fixed that.

@tristantarrant tristantarrant added this to the 14.0.0.Final milestone Sep 26, 2022
@ryanemerson ryanemerson merged commit e006713 into infinispan:main Sep 26, 2022
@ryanemerson
Copy link
Contributor

Thanks @tristantarrant

@tristantarrant tristantarrant deleted the ISPN-14144/whoexec branch April 12, 2023 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants