Skip to content

Commit

Permalink
rename property, add migration into
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Klotz <[email protected]>
  • Loading branch information
StefanKlt committed Sep 6, 2019
1 parent 8e82e58 commit ef69a06
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 16 deletions.
6 changes: 5 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
- Annotation `org.eclipse.hawkbit.ddi.resource.EnableDirectDeviceApi` have changed to `org.eclipse.hawkbit.ddi.annotation.EnableDdiApi`

### Renamed maven modules
- Module hawkbit-mgmt-api-client have changed to hawkbit-example-mgmt-simulator
- Module hawkbit-mgmt-api-client have changed to hawkbit-example-mgmt-simulator

## Milestone 0.3.0M6
### Configuration Property changes
- hawkbit.server.security.dos.maxTargetsPerManualAssignment has changed to hawkbit.server.security.dos.maxTargetDistributionSetAssignmentsPerManualAssignment
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ public interface QuotaManagement {
int getMaxTargetsPerRolloutGroup();

/**
* @return the maximum number of actions resulting from a manual assignment
* of distribution sets and targets
* @return the maximum number of target distribution set assignments
* resulting from a manual assignment
*/
int getMaxResultingActionsPerManualAssignment();
int getMaxTargetDistributionSetAssignmentsPerManualAssignment();

/**
* @return the maximum number of targets for an automatic distribution set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public int getMaxActionsPerTarget() {
}

@Override
public int getMaxResultingActionsPerManualAssignment() {
return securityProperties.getDos().getMaxResultingActionsPerManualAssignment();
public int getMaxTargetDistributionSetAssignmentsPerManualAssignment() {
return securityProperties.getDos().getMaxTargetDistributionSetAssignmentsPerManualAssignment();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ private void checkQuotaForAssignment(final Collection<DeploymentRequest> deploym

private void enforceMaxAssignmentsPerRequest(final int requestedActions) {
QuotaHelper.assertAssignmentRequestSizeQuota(requestedActions,
quotaManagement.getMaxResultingActionsPerManualAssignment());
quotaManagement.getMaxTargetDistributionSetAssignmentsPerManualAssignment());
}

private void enforceMaxActionsPerTarget(final Collection<DeploymentRequest> deploymentRequests) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ public void assertMaxActionsPerTargetQuotaIsEnforced() {
}

@Test
@Description("An assignment request that would lead to more actions than allowed by 'maxResultingActionsPerManualAssignment' quota throws an exception.")
@Description("An assignment request with more assignments than allowed by 'maxTargetDistributionSetAssignmentsPerManualAssignment' quota throws an exception.")
public void assignmentRequestThatIsTooLarge() {
final int maxActions = quotaManagement.getMaxResultingActionsPerManualAssignment();
final int maxActions = quotaManagement.getMaxTargetDistributionSetAssignmentsPerManualAssignment();
final DistributionSet ds1 = testdataFactory.createDistributionSet("1");
final DistributionSet ds2 = testdataFactory.createDistributionSet("2");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ public void assignTargetsToDistributionSetIgnoreCase() throws Exception {
}

@Test
@Description("Ensures that multi target assignment is protected by our getMaxResultingActionsPerManualAssignment quota.")
@Description("Ensures that multi target assignment is protected by our getMaxTargetDistributionSetAssignmentsPerManualAssignment quota.")
public void assignMultipleTargetsToDistributionSetUntilQuotaIsExceeded() throws Exception {
final int maxActions = quotaManagement.getMaxResultingActionsPerManualAssignment();
final int maxActions = quotaManagement.getMaxTargetDistributionSetAssignmentsPerManualAssignment();
final List<Target> targets = testdataFactory.createTargets(maxActions + 1);
final DistributionSet ds = testdataFactory.createDistributionSet();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public static class Dos {
* Maximum number of actions resulting from a manual assignment of
* distribution sets and targets. Must be greater than 1000.
*/
private int maxResultingActionsPerManualAssignment = 5000;
private int maxTargetDistributionSetAssignmentsPerManualAssignment = 5000;

/**
* Maximum number of targets for an automatic distribution set
Expand Down Expand Up @@ -379,12 +379,13 @@ public void setMaxActionsPerTarget(final int maxActionsPerTarget) {
this.maxActionsPerTarget = maxActionsPerTarget;
}

public int getMaxResultingActionsPerManualAssignment() {
return maxResultingActionsPerManualAssignment;
public int getMaxTargetDistributionSetAssignmentsPerManualAssignment() {
return maxTargetDistributionSetAssignmentsPerManualAssignment;
}

public void setMaxResultingActionsPerManualAssignment(final int maxResultingActionsPerManualAssignment) {
this.maxResultingActionsPerManualAssignment = maxResultingActionsPerManualAssignment;
public void setMaxTargetDistributionSetAssignmentsPerManualAssignment(
final int maxTargetDistributionSetAssignmentsPerManualAssignment) {
this.maxTargetDistributionSetAssignmentsPerManualAssignment = maxTargetDistributionSetAssignmentsPerManualAssignment;
}

public int getMaxTargetsPerAutoAssignment() {
Expand Down

0 comments on commit ef69a06

Please sign in to comment.