-
Notifications
You must be signed in to change notification settings - Fork 388
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
OAK-6756: Convert oak-auth-external to OSGi R7 annotations #1371
Conversation
- minimize differences in OSGi SCR metadata
With the last commit, the diff in OSGi metadata is as follows
|
@jsedding , thanks.... but honestly i am not sure that the new diff is actually good or still needs some work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbaedke , the changes looks reasonable to me and i just had 2 questions about the duplication of certain properties.
however, i have found in the past the this type of conversion is prone to subtle changes that are hard to spot but with huge impact (regressions). did you test the changes at hand with an AEMaaCS deployment that comes with external-authentication out of the box?
LoginModuleFactory.class, | ||
SyncHandlerMapping.class | ||
}, | ||
property = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbaedke , these 3 properties are also present as AttributeDefinitions in the configuration below. what is the impact of having them listed here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are default service properties for the case when no configuration is present. I agree (and have discussed with @mbaedke) that they are not strictly necessary here, because ConfigurationPolicy.REQUIRE
enforces the presence of a configuration, which then contributes these values to the service properties.
I added them to eliminate them from the diff (they were there before the change), partially because I once got bitten by a similar seemingly innocuous change. If you prefer, I think we can safely remove them here.
PrincipalConfiguration.class, | ||
SecurityConfiguration.class | ||
}, | ||
property = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case we don't have ConfigurationPolicy.REQUIRED
. That means the component is started without configuration. Without having these default service properties, they would be missing from a service without configuration. AFAIK the property oak.security.name
is used by consumers of this service to verify the presence of various implementations. Thus, in the absence of this property and the service running without explicit configuration, there is a high chance for a regression. I recommend keeping these properties.
@anchela At the risk of explaining things you already know, here I go. Most remaining diffs relate to the metatype, which is informational and used predominantly for the rendering of configuration UIs. The most risky diff in the metatype is IMHO the removal of the Designates > pid field. This seems to be a recurring pattern in this sort of refactoring, and I assume that it defaults to the value of the line above (not sure what it's called). The only change in the declarative services XML is the change of two field from method injection to field injection. I did this, because I suspect that the previous implementation was not 100% correct. I think that during an "update" of a bound service, if the reference is dynamic (which it isn't here), the "bind" method is called before the "unbind" method. I.e. in "unbind" you need to check if the value in the field and the value to be unbound are the same object before you set it to null. Since the bind/unbind methods in question had no other logic than setting the field, I thought it safer to switch them to field injection. TL;DR - With all that said, I am confident that this PR is good to be merged. 🙂 |
@anchela I only tested with a local QS build. I don't even know if I can easily access testing platforms for AEMaaCS deployments as an external dev. |
@jsedding Re removal of the pid field: AFAIU the Felix SCM plugin just creates this explicitly with the default value. I have never seen that it causes problems to drop that. |
I read the spec on the subject of the
Source: https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.metatype.html#i1492258 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see previous comment. lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well!
done.