You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2021/06/02 11:56:14 UTC
[brooklyn-server] branch master updated (b18dd9c -> c4b5fb2)
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git.
from b18dd9c This closes #1177
new 5ab7baf Fix issue where vault not ready on init
new e758875 Remove Config change listener
new 69a216d Merge pull request #1178 from duncangrant/fix-vault-with-security-provider
new 7157f7f Fixed implementation to re-order spec tag values
new c4b5fb2 This closes #1179
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../provider/DelegatingSecurityProvider.java | 29 ++++------------------
.../brooklyn/rest/transform/TypeTransformer.java | 13 +++++-----
2 files changed, 11 insertions(+), 31 deletions(-)
[brooklyn-server] 03/05: Merge pull request #1178 from
duncangrant/fix-vault-with-security-provider
Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit 69a216dd23f5de05a6d0271ba78f8f26e2c594be
Merge: b18dd9c e758875
Author: Duncan Grant <du...@gmail.com>
AuthorDate: Wed Jun 2 04:53:40 2021 -0400
Merge pull request #1178 from duncangrant/fix-vault-with-security-provider
Fix issue where vault not ready on init
.../provider/DelegatingSecurityProvider.java | 29 ++++------------------
1 file changed, 5 insertions(+), 24 deletions(-)
[brooklyn-server] 02/05: Remove Config change listener
Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit e758875e08a353a0bf6452b4597f3783b98a8331
Author: Duncan Grant <du...@cloudsoft.io>
AuthorDate: Tue Jun 1 14:31:26 2021 +0100
Remove Config change listener
This was causing a memory leak as every request creates a new
DelegatingSecurityProvider and this registers a config change listener.
On config change the delegate security provider would then attempt a
reload 1000s of times although only one would actually have effect and
the rest would then use the cached delegate.
This wasn't needed and the functionality remains the same - minus the
leak of memory.
---
.../provider/DelegatingSecurityProvider.java | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/DelegatingSecurityProvider.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/DelegatingSecurityProvider.java
index 4a9f556..0805089 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/DelegatingSecurityProvider.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/DelegatingSecurityProvider.java
@@ -47,24 +47,9 @@ public class DelegatingSecurityProvider implements SecurityProvider {
public DelegatingSecurityProvider(ManagementContext mgmt) {
this.mgmt = mgmt;
- mgmt.addPropertiesReloadListener(new PropertiesListener());
}
private SecurityProvider delegate;
- private final AtomicLong modCount = new AtomicLong();
-
- private class PropertiesListener implements ManagementContext.PropertiesReloadListener {
- private static final long serialVersionUID = 8148722609022378917L;
-
- @Override
- public void reloaded() {
- log.debug("{} reloading security provider", DelegatingSecurityProvider.this);
- synchronized (DelegatingSecurityProvider.this) {
- loadDelegate();
- invalidateExistingSessions();
- }
- }
- }
public synchronized SecurityProvider getDelegate() {
if (delegate == null) {
@@ -197,13 +182,6 @@ public class DelegatingSecurityProvider implements SecurityProvider {
return (SecurityProvider) delegateO;
}
- /**
- * Causes all existing sessions to be invalidated.
- */
- protected void invalidateExistingSessions() {
- modCount.incrementAndGet();
- }
-
@Override
public boolean isAuthenticated(HttpSession session) {
return getDelegate().isAuthenticated(session);
[brooklyn-server] 05/05: This closes #1179
Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit c4b5fb2e3a5811d5b55957f2b7fbab94f0d366ec
Merge: 69a216d 7157f7f
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Wed Jun 2 12:55:55 2021 +0100
This closes #1179
.../org/apache/brooklyn/rest/transform/TypeTransformer.java | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
[brooklyn-server] 04/05: Fixed implementation to re-order spec tag
values
Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit 7157f7fb163624e25707257ddc2742c43f8f3ef8
Author: iuliana <iu...@cloudsoft.io>
AuthorDate: Wed Jun 2 11:17:35 2021 +0100
Fixed implementation to re-order spec tag values
---
.../org/apache/brooklyn/rest/transform/TypeTransformer.java | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
index 683d9d2..a047a85 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
@@ -101,7 +101,7 @@ public class TypeTransformer {
}
}
- // adding tag type spec hierarchy using hierarchy tag
+ // create summary tag for the current plan
SpecSummary currentSpec = SpecSummary.builder()
.format(StringUtils.isBlank(item.getPlan().getPlanFormat()) ? CampTypePlanTransformer.FORMAT : item.getPlan().getPlanFormat())
// the default type implementation is camp in this location, but hierarchy tag provides the original implementation, so it takes precedence.
@@ -110,14 +110,13 @@ public class TypeTransformer {
.build();
List<SpecSummary> specTag = BrooklynTags.findSpecHierarchyTag(item.getTags());
+ List<SpecSummary> specList = MutableList.of(currentSpec);
if(specTag!= null){
- SpecSummary.modifyHeadSummary(specTag, s -> "Converted to "+s);
- SpecSummary.pushToList(specTag, currentSpec);
- } else {
- specTag = MutableList.of(currentSpec);
+ // put the original spec tags first
+ SpecSummary.modifyHeadSummary(specList, s -> "Converted to "+s);
+ SpecSummary.pushToList(specList, specTag);
}
-
- result.setExtraField("specList", specTag);
+ result.setExtraField("specList", specList);
if (detail) {
if (RegisteredTypes.isSubtypeOf(item, Entity.class)) {
[brooklyn-server] 01/05: Fix issue where vault not ready on init
Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit 5ab7baf5fb2d1136ccce24bc2764676247d28474
Author: Duncan Grant <du...@cloudsoft.io>
AuthorDate: Tue Jun 1 09:20:16 2021 +0100
Fix issue where vault not ready on init
If vault is used for security provider and is not ready on startup then
the security provider will fail and will be replaced by the
BlackholeSecurityProvider. This change means that whenever a security
provider fails, the DelegatingSecurityProvider will attempt to
re-initialize it on subsequent authorization attempts.
---
.../rest/security/provider/DelegatingSecurityProvider.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/DelegatingSecurityProvider.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/DelegatingSecurityProvider.java
index 0463cf0..4a9f556 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/DelegatingSecurityProvider.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/DelegatingSecurityProvider.java
@@ -98,22 +98,25 @@ public class DelegatingSecurityProvider implements SecurityProvider {
log.info("Brooklyn security: using security provider " + className + " from " + bundle+":"+bundleVersion);
BundleContext bundleContext = ((ManagementContextInternal)mgmt).getOsgiManager().get().getFramework().getBundleContext();
delegate = loadProviderFromBundle(mgmt, bundleContext, bundle, bundleVersion, className);
+ saveDelegate();
} else {
log.info("Brooklyn security: using security provider " + className);
ClassLoaderUtils clu = new ClassLoaderUtils(this, mgmt);
Class<? extends SecurityProvider> clazz = (Class<? extends SecurityProvider>) clu.loadClass(className);
delegate = createSecurityProviderInstance(mgmt, clazz);
+ saveDelegate();
}
} catch (Exception e) {
log.warn("Brooklyn security: unable to instantiate security provider " + className + "; all logins are being disallowed", e);
delegate = new BlackholeSecurityProvider();
}
+ return delegate;
+ }
+ private void saveDelegate() {
// Deprecated in 0.11.0. Add to release notes and remove in next release.
((BrooklynProperties)mgmt.getConfig()).put(BrooklynWebConfig.SECURITY_PROVIDER_INSTANCE, delegate);
mgmt.getScratchpad().put(BrooklynWebConfig.SECURITY_PROVIDER_INSTANCE, delegate);
-
- return delegate;
}
public static SecurityProvider loadProviderFromBundle(