[jira] [Created] (KARAF-5602) Upgrade to Spring Security 4.2.4.RELEASE
Jean-Baptiste Onofré created KARAF-5602: --- Summary: Upgrade to Spring Security 4.2.4.RELEASE Key: KARAF-5602 URL: https://issues.apache.org/jira/browse/KARAF-5602 Project: Karaf Issue Type: Dependency upgrade Components: karaf-core Reporter: Jean-Baptiste Onofré Assignee: Jean-Baptiste Onofré Fix For: 4.2.0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KARAF-5597) Upgrade to Spring 4.3.14.RELEASE
[ https://issues.apache.org/jira/browse/KARAF-5597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16356566#comment-16356566 ] ASF GitHub Bot commented on KARAF-5597: --- jbonofre opened a new pull request #443: [KARAF-5597] Upgrade to Spring 4.3.14.RELEASE URL: https://github.com/apache/karaf/pull/443 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Upgrade to Spring 4.3.14.RELEASE > > > Key: KARAF-5597 > URL: https://issues.apache.org/jira/browse/KARAF-5597 > Project: Karaf > Issue Type: Dependency upgrade > Components: karaf-core >Reporter: Jean-Baptiste Onofré >Assignee: Jean-Baptiste Onofré >Priority: Major > Fix For: 4.0.11, 4.2.0, 4.1.5 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KARAF-5596) Upgrade to Spring 5.0.3.RELEASE
[ https://issues.apache.org/jira/browse/KARAF-5596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16356560#comment-16356560 ] ASF GitHub Bot commented on KARAF-5596: --- jbonofre opened a new pull request #442: [KARAF-5596] Upgrade to Spring 5.0.3.RELEASE URL: https://github.com/apache/karaf/pull/442 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Upgrade to Spring 5.0.3.RELEASE > --- > > Key: KARAF-5596 > URL: https://issues.apache.org/jira/browse/KARAF-5596 > Project: Karaf > Issue Type: Dependency upgrade > Components: karaf-core >Reporter: Jean-Baptiste Onofré >Assignee: Jean-Baptiste Onofré >Priority: Major > Fix For: 4.0.11, 4.2.0, 4.1.5 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (KARAF-5601) Array values in configurations are printed as pointer addresses when using shell commands
[ https://issues.apache.org/jira/browse/KARAF-5601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Steven Lombardi updated KARAF-5601: --- Description: To reproduce: * Start editing any configuration with an array-valued property using {{config:edit}} * Run {{config:property-list}} and notice that the array does not print correctly * Run {{config:property-get}} for the name of the array-valued property and notice the array does not print correctly Example: {code:java} admin@root()> config:property-list customMimeTypes = [Ljava.lang.String;@2b1de817 felix.fileinstall.filename = file:/Users/lambeaux/Connexta/instances/ddf-2.11.5-SNAPSHOT/etc/DDF_Custom_Mime_Type_Resolver-xml.config name = XML Metacard Content Resolver priority = 10 schema = urn:catalog:metacard service.factoryPid = DDF_Custom_Mime_Type_Resolver service.pid = DDF_Custom_Mime_Type_Resolver.e12a9162-e152-4a2d-bc7e-537d3621eac7 admin@root()> config:property-get priority 10 admin@root()> config:property-get schema urn:catalog:metacard admin@root()> config:property-get name XML Metacard Content Resolver admin@root()> config:property-get customMimeTypes [Ljava.lang.String;@2b1de817 {code} was: To reproduce: * Start editing any configuration with an array-valued property using {{config:edit}} * Run {{config:property-list}} and notice that the array does not print correctly * Run {{config:property-get}} for the name of the array-valued property and notice the array does not print correctly Example: {code:java} // code placeholder {code} > Array values in configurations are printed as pointer addresses when using > shell commands > - > > Key: KARAF-5601 > URL: https://issues.apache.org/jira/browse/KARAF-5601 > Project: Karaf > Issue Type: Bug > Components: karaf-shell >Affects Versions: 4.1.4 > Environment: OS X El Capitan 10.11.6 >Reporter: Steven Lombardi >Priority: Minor > > To reproduce: > * Start editing any configuration with an array-valued property using > {{config:edit}} > * Run {{config:property-list}} and notice that the array does not print > correctly > * Run {{config:property-get}} for the name of the array-valued property and > notice the array does not print correctly > Example: > {code:java} > admin@root()> config:property-list >customMimeTypes = [Ljava.lang.String;@2b1de817 >felix.fileinstall.filename = > file:/Users/lambeaux/Connexta/instances/ddf-2.11.5-SNAPSHOT/etc/DDF_Custom_Mime_Type_Resolver-xml.config > >name = XML Metacard Content Resolver >priority = 10 >schema = urn:catalog:metacard >service.factoryPid = DDF_Custom_Mime_Type_Resolver >service.pid = > DDF_Custom_Mime_Type_Resolver.e12a9162-e152-4a2d-bc7e-537d3621eac7 > admin@root()> config:property-get priority > 10 > admin@root()> config:property-get schema > urn:catalog:metacard > admin@root()> config:property-get name > XML Metacard Content Resolver > admin@root()> config:property-get customMimeTypes > [Ljava.lang.String;@2b1de817 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (KARAF-5601) Array values in configurations are printed as pointer addresses when using shell commands
Steven Lombardi created KARAF-5601: -- Summary: Array values in configurations are printed as pointer addresses when using shell commands Key: KARAF-5601 URL: https://issues.apache.org/jira/browse/KARAF-5601 Project: Karaf Issue Type: Bug Components: karaf-shell Affects Versions: 4.1.4 Environment: OS X El Capitan 10.11.6 Reporter: Steven Lombardi To reproduce: * Start editing any configuration with an array-valued property using {{config:edit}} * Run {{config:property-list}} and notice that the array does not print correctly * Run {{config:property-get}} for the name of the array-valued property and notice the array does not print correctly Example: {code:java} // code placeholder {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (KARAF-4496) UserPrincipal lookup in the JAAS' BackingEngine
[ https://issues.apache.org/jira/browse/KARAF-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jean-Baptiste Onofré resolved KARAF-4496. - Resolution: Fixed > UserPrincipal lookup in the JAAS' BackingEngine > --- > > Key: KARAF-4496 > URL: https://issues.apache.org/jira/browse/KARAF-4496 > Project: Karaf > Issue Type: Improvement > Components: karaf-security >Reporter: Yurii Rashkovskii >Assignee: Jean-Baptiste Onofré >Priority: Minor > Labels: jaas > Fix For: 4.2.0, 4.1.5 > > > I have a suggestion for improving org.apache.karaf.jaas.modules.BackingEngine > Currently, the only way to lookup an individual user (as far as I can tell) > is to iterate through the result of BackingEngine#listUsers() and find the > required user. This is fine if the number of users is reasonably low. > However, when JAAS infrastructure is used for public systems (say, a SaaS), > it quickly becomes a bottleneck. > I suggest adding something like `public UserPrincipal lookupUser(String > name)` to avoid this problem (also, it should return `null` if no such user > found , or throw an exception) > I am happy to contribute a PR promptly if this change will be approved. > Thoughts? -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KARAF-4496) UserPrincipal lookup in the JAAS' BackingEngine
[ https://issues.apache.org/jira/browse/KARAF-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355248#comment-16355248 ] ASF subversion and git services commented on KARAF-4496: Commit 1681c35e5286388bd0dd92de657abc2617857a5d in karaf's branch refs/heads/karaf-4.1.x from [~jbonofre] [ https://gitbox.apache.org/repos/asf?p=karaf.git;h=1681c35 ] [KARAF-4496] Add lookupUser(username) method in JAAS backing engines > UserPrincipal lookup in the JAAS' BackingEngine > --- > > Key: KARAF-4496 > URL: https://issues.apache.org/jira/browse/KARAF-4496 > Project: Karaf > Issue Type: Improvement > Components: karaf-security >Reporter: Yurii Rashkovskii >Assignee: Jean-Baptiste Onofré >Priority: Minor > Labels: jaas > Fix For: 4.2.0, 4.1.5 > > > I have a suggestion for improving org.apache.karaf.jaas.modules.BackingEngine > Currently, the only way to lookup an individual user (as far as I can tell) > is to iterate through the result of BackingEngine#listUsers() and find the > required user. This is fine if the number of users is reasonably low. > However, when JAAS infrastructure is used for public systems (say, a SaaS), > it quickly becomes a bottleneck. > I suggest adding something like `public UserPrincipal lookupUser(String > name)` to avoid this problem (also, it should return `null` if no such user > found , or throw an exception) > I am happy to contribute a PR promptly if this change will be approved. > Thoughts? -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KARAF-4496) UserPrincipal lookup in the JAAS' BackingEngine
[ https://issues.apache.org/jira/browse/KARAF-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355220#comment-16355220 ] ASF GitHub Bot commented on KARAF-4496: --- jbonofre closed pull request #441: [KARAF-4496] Add lookupUser(username) method in JAAS backing engines URL: https://github.com/apache/karaf/pull/441 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java index 8638ee6d10..b5d7275a18 100644 --- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java +++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java @@ -48,6 +48,14 @@ */ List listUsers(); +/** + * Retrieve the {@link UserPrincipal} corresponding to an username, or {@code null} if user doesn't exist. + * + * @param username The username. + * @return The {@link UserPrincipal} or {@code null}. + */ +UserPrincipal lookupUser(String username); + /** * List groups that a user is member of. * diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java index 420d549f79..a21bce46bc 100644 --- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java +++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java @@ -46,6 +46,7 @@ private String deleteAllUserRolesStatement = "DELETE FROM ROLES WHERE USERNAME=?"; private String deleteUserStatement = "DELETE FROM USERS WHERE USERNAME=?"; private String selectUsersQuery = "SELECT USERNAME FROM USERS"; +private String selectUserQuery = "SELECT USERNAME FROM USERS WHERE USERNAME=?"; private String selectRolesQuery = "SELECT ROLE FROM ROLES WHERE USERNAME=?"; public JDBCBackingEngine(DataSource dataSource) { @@ -118,6 +119,21 @@ public void deleteUser(String username) { } } +@Override +public UserPrincipal lookupUser(String username) { +try { +try (Connection connection = dataSource.getConnection()) { +List names = rawSelect(connection, selectUserQuery, username); +if (names.size() == 0) { +return null; +} +return new UserPrincipal(username); +} +} catch (SQLException e) { +throw new RuntimeException("Error getting user", e); +} +} + /** * List the roles of the principal. * diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPBackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPBackingEngine.java index 4ee865e20f..90daf5dc2c 100644 --- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPBackingEngine.java +++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPBackingEngine.java @@ -62,6 +62,37 @@ public void deleteUser(String username) { throw new UnsupportedOperationException("Deleting a user is not supporting in LDAP"); } +@Override +public UserPrincipal lookupUser(String username) { +DirContext context = null; +try { +context = cache.open(); + +SearchControls controls = new SearchControls(); +if (options.getUserSearchSubtree()) { +controls.setSearchScope(SearchControls.SUBTREE_SCOPE); +} else { +controls.setSearchScope(SearchControls.ONELEVEL_SCOPE); +} + +String filter = options.getUserFilter(); +filter = filter.replaceAll(Pattern.quote("%u"), username); +filter = filter.replace("\\", ""); + +LOGGER.debug("Looking for user {} in LDAP with", username); +LOGGER.debug(" base DN: {}", options.getUserBaseDn()); +LOGGER.debug(" filter: {}", filter); + +NamingEnumeration namingEnumeration = context.search(options.getUserBaseDn(), filter, controls); +if (namingEnumeration.hasMore()) { +return new UserPrincipal(username); +} +} catch (NamingException e) { +throw new RuntimeException(e); +} +return null; +} + @Override public List listUsers() { DirContext context = null; diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java b/jaas/modules/src/main/java/org
[jira] [Commented] (KARAF-4496) UserPrincipal lookup in the JAAS' BackingEngine
[ https://issues.apache.org/jira/browse/KARAF-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355219#comment-16355219 ] ASF subversion and git services commented on KARAF-4496: Commit 76edcb8279ad8d05134fb09bb18955f88dd6ae1c in karaf's branch refs/heads/master from [~jbonofre] [ https://gitbox.apache.org/repos/asf?p=karaf.git;h=76edcb8 ] [KARAF-4496] Add lookupUser(username) method in JAAS backing engines > UserPrincipal lookup in the JAAS' BackingEngine > --- > > Key: KARAF-4496 > URL: https://issues.apache.org/jira/browse/KARAF-4496 > Project: Karaf > Issue Type: Improvement > Components: karaf-security >Reporter: Yurii Rashkovskii >Assignee: Jean-Baptiste Onofré >Priority: Minor > Labels: jaas > Fix For: 4.2.0, 4.1.5 > > > I have a suggestion for improving org.apache.karaf.jaas.modules.BackingEngine > Currently, the only way to lookup an individual user (as far as I can tell) > is to iterate through the result of BackingEngine#listUsers() and find the > required user. This is fine if the number of users is reasonably low. > However, when JAAS infrastructure is used for public systems (say, a SaaS), > it quickly becomes a bottleneck. > I suggest adding something like `public UserPrincipal lookupUser(String > name)` to avoid this problem (also, it should return `null` if no such user > found , or throw an exception) > I am happy to contribute a PR promptly if this change will be approved. > Thoughts? -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KARAF-5469) Installation of a non blueprint feature triggers the installation of the blueprint compatibility bundle
[ https://issues.apache.org/jira/browse/KARAF-5469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355161#comment-16355161 ] Joao Assuncao commented on KARAF-5469: -- Probably because I'm not using the default cxf-http-jetty feature. When I installed the regular cxf-http-jetty (3.1.10) feature I would end with two different jetty versions installed. As an workaround I created a cxf-http-jetty_fix feature with the cxf-rt-transports-http-jetty bundle. Probably I should have mention that I'm using a custom karaf distro. What I find odd, is the fact this blueprint installation only happens when I install this particular feature. > Installation of a non blueprint feature triggers the installation of the > blueprint compatibility bundle > --- > > Key: KARAF-5469 > URL: https://issues.apache.org/jira/browse/KARAF-5469 > Project: Karaf > Issue Type: Bug > Components: karaf-core >Affects Versions: 4.1.3 >Reporter: Joao Assuncao >Priority: Major > Attachments: wiring.txt > > > In Karaf 4.1.3 when installing some custom made features karaf triggers the > installation of the org.apache.aries.blueprint.core.compatibility bundle > causing a refresh of all bundles and a Karaf shutdown. > None of the bundles in the feature uses blueprint and the more exotic thing > is that one of the bundles uses a Contional-Package instruction. > The feature I'm trying to install: > {code} > karaf@root()> feature:info paybox-io-modbus > Feature paybox-io-modbus 0.1.0.SNAPSHOT > Description: > Modbus I/O implementation > Feature has no configuration > Feature has no configuration files > Feature has no dependencies. > Feature contains followed bundles: > mvn:pt.brisa.common/common-service-core/1.3.0 > mvn:pt.brisa.paybox/io-api/0.1.0-SNAPSHOT > mvn:pt.brisa.paybox/io-modbus/0.1.0-SNAPSHOT > mvn:pt.brisa.paybox/io-commands/0.1.0-SNAPSHOT > Feature has no conditionals. > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KARAF-4496) UserPrincipal lookup in the JAAS' BackingEngine
[ https://issues.apache.org/jira/browse/KARAF-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355140#comment-16355140 ] ASF GitHub Bot commented on KARAF-4496: --- jbonofre opened a new pull request #441: [KARAF-4496] Add lookupUser(username) method in JAAS backing engines URL: https://github.com/apache/karaf/pull/441 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > UserPrincipal lookup in the JAAS' BackingEngine > --- > > Key: KARAF-4496 > URL: https://issues.apache.org/jira/browse/KARAF-4496 > Project: Karaf > Issue Type: Improvement > Components: karaf-security >Reporter: Yurii Rashkovskii >Assignee: Jean-Baptiste Onofré >Priority: Minor > Labels: jaas > Fix For: 4.2.0, 4.1.5 > > > I have a suggestion for improving org.apache.karaf.jaas.modules.BackingEngine > Currently, the only way to lookup an individual user (as far as I can tell) > is to iterate through the result of BackingEngine#listUsers() and find the > required user. This is fine if the number of users is reasonably low. > However, when JAAS infrastructure is used for public systems (say, a SaaS), > it quickly becomes a bottleneck. > I suggest adding something like `public UserPrincipal lookupUser(String > name)` to avoid this problem (also, it should return `null` if no such user > found , or throw an exception) > I am happy to contribute a PR promptly if this change will be approved. > Thoughts? -- This message was sent by Atlassian JIRA (v7.6.3#76005)