Merge branch 'master' into

feature_MECS-86_tenant_specific_polling_configuration

Conflicts:
	hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java
	hawkbit-core/src/main/java/org/eclipse/hawkbit/tenancy/configuration/TenantConfigurationKey.java
	hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpControllerAuthentfication.java
	hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpControllerAuthentficationTest.java
	hawkbit-repository/src/test/resources/application-test.properties


Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-03-09 13:29:40 +01:00
143 changed files with 2716 additions and 1669 deletions

View File

@@ -9,18 +9,26 @@
package org.eclipse.hawkbit;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* Defines the polling time for the controllers in HH:MM:SS notation.
*
*
*
*/
@Component
@ConfigurationProperties(prefix = "hawkbit.controller")
public class ControllerPollProperties {
/**
* Recommended target polling time for DDI API. Final choice is up to the
* target.
*/
private String pollingTime = "00:05:00";
/**
* Assumed time frame where the target is considered overdue when no DDI
* polling has been registered by the update server.
*/
private String pollingOverdueTime = "00:05:00";
private String maxPollingTime = "23:59:00";
private String minPollingTime = "00:00:30";

View File

@@ -0,0 +1,97 @@
/**
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Properties for the server e.g. the server's URL which must be configured.
*
*/
@ConfigurationProperties("hawkbit.server")
public class HawkbitServerProperties {
/**
* Defines under which URI the update server can be reached. Used to
* calculate download URLs for DMF transmitted update actions.
*/
private String url = "http://localhost:8080";
private final Build build = new Build();
public Build getBuild() {
return build;
}
/**
* Build information of the hawkBit instance. Influenced by maven.
*
*/
public static class Build {
/**
* Project artifact ID.
*/
private String artifact = "";
/**
* Project name.
*/
private String name = "";
/**
* Project description.
*/
private String description = "";
/**
* Project version.
*/
private String version = "";
public String getArtifact() {
return artifact;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public String getVersion() {
return version;
}
public void setArtifact(final String artifact) {
this.artifact = artifact;
}
public void setName(final String name) {
this.name = name;
}
public void setDescription(final String description) {
this.description = description;
}
public void setVersion(final String version) {
this.version = version;
}
}
public String getUrl() {
return url;
}
public void setUrl(final String url) {
this.url = url;
}
}

View File

@@ -51,7 +51,12 @@ public class TenantAwareCacheManager implements TenancyCacheManager {
@Override
public Cache getCache(final String name) {
final String currentTenant = tenantAware.getCurrentTenant().toUpperCase();
String currentTenant = tenantAware.getCurrentTenant();
if (currentTenant == null) {
return null;
}
currentTenant = currentTenant.toUpperCase();
if (currentTenant.contains(TENANT_CACHE_DELIMITER)) {
return null;
}
@@ -60,7 +65,12 @@ public class TenantAwareCacheManager implements TenancyCacheManager {
@Override
public Collection<String> getCacheNames() {
final String currentTenant = tenantAware.getCurrentTenant().toUpperCase();
String currentTenant = tenantAware.getCurrentTenant();
if (currentTenant == null) {
return null;
}
currentTenant = currentTenant.toUpperCase();
if (currentTenant.contains(TENANT_CACHE_DELIMITER)) {
return Collections.emptyList();
}

View File

@@ -20,7 +20,12 @@ public enum ActionStatusFields implements FieldNameProvider {
/**
* The id field.
*/
ID("id");
ID("id"),
/**
* The reportedAt field.
*/
REPORTEDAT("createdAt");
private final String fieldName;

View File

@@ -29,32 +29,32 @@ public enum TenantConfigurationKey {
* boolean value {@code true} {@code false}.
*/
AUTHENTICATION_MODE_HEADER_ENABLED("authentication.header.enabled",
"hawkbit.server.controller.security.authentication.header.enabled", Boolean.class, Boolean.FALSE.toString(),
"hawkbit.server.ddi.security.authentication.header.enabled", Boolean.class, Boolean.FALSE.toString(),
TenantConfigurationBooleanValidator.class),
/**
*
*/
AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME("authentication.header.authority",
"hawkbit.server.controller.security.authentication.header.authority", String.class,
Boolean.FALSE.toString(), TenantConfigurationStringValidator.class),
"hawkbit.server.ddi.security.authentication.header.authority", String.class, Boolean.FALSE.toString(),
TenantConfigurationStringValidator.class),
/**
* boolean value {@code true} {@code false}.
*/
AUTHENTICATION_MODE_TARGET_SECURITY_TOKEN_ENABLED("authentication.targettoken.enabled",
"hawkbit.server.controller.security.authentication.targettoken.enabled", Boolean.class,
Boolean.FALSE.toString(), TenantConfigurationBooleanValidator.class),
"hawkbit.server.ddi.security.authentication.targettoken.enabled", Boolean.class, Boolean.FALSE.toString(),
TenantConfigurationBooleanValidator.class),
/**
* boolean value {@code true} {@code false}.
*/
AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_ENABLED("authentication.gatewaytoken.enabled",
"hawkbit.server.controller.security.authentication.gatewaytoken.enabled", Boolean.class,
Boolean.FALSE.toString(), TenantConfigurationBooleanValidator.class),
"hawkbit.server.ddi.security.authentication.gatewaytoken.enabled", Boolean.class, Boolean.FALSE.toString(),
TenantConfigurationBooleanValidator.class),
/**
* string value which holds the name of the security token key.
*/
AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_NAME("authentication.gatewaytoken.name",
"hawkbit.server.controller.security.authentication.gatewaytoken.name", String.class, null,
"hawkbit.server.ddi.security.authentication.gatewaytoken.name", String.class, null,
TenantConfigurationStringValidator.class),
/**
@@ -62,7 +62,7 @@ public enum TenantConfigurationKey {
* token.
*/
AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY("authentication.gatewaytoken.key",
"hawkbit.server.controller.security.authentication.gatewaytoken.key", String.class, null,
"hawkbit.server.ddi.security.authentication.gatewaytoken.key", String.class, null,
TenantConfigurationStringValidator.class),
/**