TriggeringUsersAuthorizationStrategy
---
security:
queueItemAuthenticator:
authenticators:
- global:
strategy: "triggeringUsersAuthorizationStrategy"
Issues 1) When exporting the configuration in case SpecificUsersAuthorizationStrategy is configured, the below exception is thrown.
security:
queueItemAuthenticator:
authenticators:
- global:
strategy: |-
FAILED TO EXPORT
org.jenkinsci.plugins.authorizeproject.GlobalQueueItemAuthenticator#strategy: io.jenkins.plugins.casc.ConfiguratorException: Can't read attribute 'useApitoken' from org.jenkinsci.plugins.authorizeproject.strategy.SpecificUsersAuthorizationStrategy@1127ad4c
at io.jenkins.plugins.casc.Attribute._getValue(Attribute.java:392)
at io.jenkins.plugins.casc.Attribute.getValue(Attribute.java:214)
at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:283)
...
That's because the constructor of SpecificUsersAuthorizationStrategy contains 3 parameters (useApitoken, apitoken, password) that are not used as fields in the class. Therefore JCasC cannot find them. I had a look at the git history. It shows that readResolve() and newInstance() have already been used in the past to perform some checks. After seeing the details/fixed issues in the git history, it's not clear to me where to move this check (which requires these 3 values from the web request). 2) Configuring & exporting the configuration for "project-level" strategies does not work at all. That's because: a) The constructor of ProjectQueueItemAuthenticator has no @DataBoundConstructor annotation. b) The field strategyEnabledMap is a Map which is not supported by JCasC. After adding the @DataBoundConstructor annotation, when trying to somehow configure the strategies, the below exception is thrown.
Cannot find configurator for type java.util.Map<java.lang.String, java.lang.Boolean>
io.jenkins.plugins.casc.ConfiguratorException: Cannot find configurator for type java.util.Map<java.lang.String, java.lang.Boolean>
at io.jenkins.plugins.casc.impl.DefaultConfiguratorRegistry$1.load(DefaultConfiguratorRegistry.java:96)
at io.jenkins.plugins.casc.impl.DefaultConfiguratorRegistry$1.load(DefaultConfiguratorRegistry.java:92)
...
ikedam / Joseph Petersen / Tim Jacomb do you have suggestions how to resolve these issues? |