public HostEffectConstraint(List<String> allowed) { super(); this.user = true; this.global = false; this.hostsHolder = new HostsHolder(allowed); this.readOnly = false; this.readOnlyConstraint = new HostEffectConstraint(this.hostsHolder, true); }
boolean anyMatch = anyMatch(ourSpecific, hecSpecific); if (!anyMatch) ControllerLogger.ACCESS_LOGGER.tracef("read-only host constraint violated " + "for action %s due to no match between hosts %s and allowed hosts %s", } else { boolean anyMatch = anyMatch(ourSpecific, hecSpecific); if (!anyMatch) ControllerLogger.ACCESS_LOGGER.tracef("host constraint violated " + "for action %s due to no match between hosts %s and allowed hosts %s",
private void applyChangeToConstraint(final ModelNode operation, final ModelNode resolvedValue) { final String roleName = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue(); HostEffectConstraint constraint = constraintMap.get(roleName); // null means the resource shouldn't exist and we should have failed in Stage.MODEL assert constraint != null : "unknown role " + roleName; List<String> hosts = new ArrayList<String>(); if (resolvedValue.isDefined()) { for (ModelNode host : resolvedValue.asList()) { hosts.add(host.asString()); } } constraint.setAllowedHosts(hosts); }
boolean anyMatch = anyMatch(ourSpecific, hecSpecific); if (!anyMatch) ControllerLogger.ACCESS_LOGGER.tracef("read-only host constraint violated " + "for action %s due to no match between hosts %s and allowed hosts %s", } else { boolean anyMatch = anyMatch(ourSpecific, hecSpecific); if (!anyMatch) ControllerLogger.ACCESS_LOGGER.tracef("host constraint violated " + "for action %s due to no match between hosts %s and allowed hosts %s",
private void applyChangeToConstraint(final ModelNode operation, final ModelNode resolvedValue) { final String roleName = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue(); HostEffectConstraint constraint = constraintMap.get(roleName); // null means the resource shouldn't exist and we should have failed in Stage.MODEL assert constraint != null : "unknown role " + roleName; List<String> hosts = new ArrayList<String>(); if (resolvedValue.isDefined()) { for (ModelNode host : resolvedValue.asList()) { hosts.add(host.asString()); } } constraint.setAllowedHosts(hosts); }
public HostEffectConstraint(List<String> allowed) { super(); this.user = true; this.global = false; this.hostsHolder = new HostsHolder(allowed); this.readOnly = false; this.readOnlyConstraint = new HostEffectConstraint(this.hostsHolder, true); }
boolean anyMatch = anyMatch(ourSpecific, hecSpecific); if (!anyMatch) ControllerLogger.ACCESS_LOGGER.tracef("read-only host constraint violated " + "for action %s due to no match between hosts %s and allowed hosts %s", } else { boolean anyMatch = anyMatch(ourSpecific, hecSpecific); if (!anyMatch) ControllerLogger.ACCESS_LOGGER.tracef("host constraint violated " + "for action %s due to no match between hosts %s and allowed hosts %s",
public HostEffectConstraint(List<String> allowed) { super(); this.user = true; this.global = false; this.hostsHolder = new HostsHolder(allowed); this.readOnly = false; this.readOnlyConstraint = new HostEffectConstraint(this.hostsHolder, true); }
static void addScopedRole(final String roleName, final String baseRole, final List<ModelNode> hostNodes, final WritableAuthorizerConfiguration authorizerConfiguration, final Map<String, HostEffectConstraint> constraintMap) { List<String> hosts = new ArrayList<String>(); for (ModelNode host : hostNodes) { hosts.add(host.asString()); } HostEffectConstraint constraint = new HostEffectConstraint(hosts); authorizerConfiguration.addScopedRole(new AuthorizerConfiguration.ScopedRole(roleName, baseRole, constraint)); constraintMap.put(roleName, constraint); } }
static void addScopedRole(final String roleName, final String baseRole, final List<ModelNode> hostNodes, final WritableAuthorizerConfiguration authorizerConfiguration, final Map<String, HostEffectConstraint> constraintMap) { List<String> hosts = new ArrayList<String>(); for (ModelNode host : hostNodes) { hosts.add(host.asString()); } HostEffectConstraint constraint = new HostEffectConstraint(hosts); authorizerConfiguration.addScopedRole(new AuthorizerConfiguration.ScopedRole(roleName, baseRole, constraint)); constraintMap.put(roleName, constraint); } }
private Constraint getRequiredConstraint(HostEffect hostEffect) { if (hostEffect == null || hostEffect.isHostEffectGlobal()) { return GLOBAL_REQUIRED; } return new HostEffectConstraint(hostEffect.getAffectedHosts()); }
private Constraint getRequiredConstraint(HostEffect hostEffect) { if (hostEffect == null || hostEffect.isHostEffectGlobal()) { return GLOBAL_REQUIRED; } return new HostEffectConstraint(hostEffect.getAffectedHosts()); }
private Constraint getRequiredConstraint(HostEffect hostEffect) { if (hostEffect == null || hostEffect.isHostEffectGlobal()) { return GLOBAL_REQUIRED; } return new HostEffectConstraint(hostEffect.getAffectedHosts()); }