Repository navigation
FELIX-6877 maven-bundle-plugin: quote blueprint service header values - #595
Conversation
BlueprintPlugin rebuilt Import-Service / Export-Service with felix-utils Clause.toString(), which only quotes values containing ','. Filters like (ns=http://...) were written unquoted, and bnd >= 7.2, which parses the header again, truncated them at the first '='. Quote every directive and attribute value that is not a plain OSGi "extended" value. Extend BlueprintComponentTest to parse Import-Service with bnd's OSGiHeader and check the complete namespace filters. Signed-off-by: Holger Friedrich <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for the fix. One blocker: Backslashes are doubled on round trip. A filter such as That is a different and invalid filter. Before this PR, backslashes passed through unchanged, so this is a regression for any value with an LDAP-escaped character ( Suggested fix: in if ( c == '"' )
{
sb.append( '\\' );
}
sb.append( c );Please also add a test with a backslash in a filter. Minor, not blocking: the new assertions only run for |
Replace appendValue, which doubled backslashes, with bnd's Attrs/OSGiHeader.quote. Parse a configured Import-Service/Export-Service with bnd so single quotes and \" escapes are kept. Also quote generic mode values, fix the filter for a reference with both filter and component-name, and add tests incl. generic mode. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
|
Thanks, you were right about the backslashes. Fixed in the new commit: values are now quoted with bnd's OSGiHeader.quote, so bnd reads them back unchanged. Tests: the new BlueprintPluginTest covers backslashes, quotes and generic mode, and BlueprintComponentTest now checks the namespace filters in generic mode too. |
Signed-off-by: Holger Friedrich <[email protected]>
|
Lgtm |
BlueprintPlugin rebuilt Import-Service / Export-Service with felix-utils Clause.toString(), which only quotes values containing ','. Filters like (ns=http://...) were written unquoted, and bnd >= 7.2, which parses the header again, truncated them at the first '='.
Quote every directive and attribute value that is not a plain OSGi "extended" value. Extend BlueprintComponentTest to parse Import-Service with bnd's OSGiHeader and check the complete namespace filters.
https://issues.apache.org/jira/browse/FELIX-6877