Enforce any security annotations applicable to the ApplyRequestValues phase

@param event
350433
public void observeApplyRequestValues(@Observes @Before @ApplyRequestValues PhaseEvent event) {
        log.debug("After Apply Request Values event");
        performObservation(event, PhaseIdType.APPLY_REQUEST_VALUES);
    }
360184
@Check
	public void checkSuperConstructor(SarlEvent event) {
		checkSuperConstructor(
				event,
				XTEND_TYPE_DECLARATION__NAME,
				doGetConstructorParameterTypes(Event.class, event));
	}
796251
public static void validateStringValue(String value) throws ParameterException {
		Validate.notNull(value);
		Validate.notEmpty(value);
	}
1021400
public void handleSubmit(VariableScope variableScope, VariableMap values, VariableMap allValues) {
    TypedValue submittedValue = (TypedValue) values.getValueTyped(id);
    values.remove(id);

    // perform validation
    for (FormFieldValidationConstraintHandler validationHandler : validationHandlers) {
      Object value = null;
      if(submittedValue != null) {
        value = submittedValue.getValue();
      }
      validationHandler.validate(value, allValues, this, variableScope);
    }

    // update variable(s)
    TypedValue modelValue = null;
    if (submittedValue != null) {
      if (type != null) {
        modelValue = type.convertToModelValue(submittedValue);
      }
      else {
        modelValue = submittedValue;
      }
    }
    else if (defaultValueExpression != null) {
      final TypedValue expressionValue = Variables.untypedValue(defaultValueExpression.getValue(variableScope));
      if (type != null) {
        // first, need to convert to model value since the default value may be a String Constant specified in the model xml.
        modelValue = type.convertToModelValue(Variables.untypedValue(expressionValue));
      }
      else if (expressionValue != null) {
        modelValue = Variables.stringValue(expressionValue.getValue().toString());
      }
    }

    if (modelValue != null) {
      if (id != null) {
        variableScope.setVariable(id, modelValue);
      }
    }
  }
1274070
@Override
    public void onApplicationEvent(HttpSessionDestroyedEvent event) {
        final HttpSession session = ((HttpSessionDestroyedEvent) event).getSession();
        @SuppressWarnings("unchecked")
        final Map<String, PortletSession> portletSessions =
                (Map<String, PortletSession>) session.getAttribute(PORTLET_SESSIONS_MAP);
        if (portletSessions == null) {
            return;
        }

        /*
         * Since (at least) Tomcat 7.0.47, this method has the potential to
         * generate a StackOverflowError because PortletSession.invalidate()
         * will trigger another HttpSessionDestroyedEvent, which means this
         * method will be called again.  I don't know if this behavior is a bug
         * in Tomcat or Spring, if this behavior is entirely proper, or if the
         * reality somewhere in between.
         *
         * For the present, let's put a token in the HttpSession (which is
         * available from the event object) as soon as we start invalidating it.
         * We'll then ignore sessions that already have this token.
         */
        if (session.getAttribute(ALREADY_INVALIDATING_SESSION_ATTRIBUTE) != null) {
            // We're already invalidating;  don't do it again
            return;
        }
        session.setAttribute(ALREADY_INVALIDATING_SESSION_ATTRIBUTE, Boolean.TRUE);

        for (final Map.Entry<String, PortletSession> portletSessionEntry :
                portletSessions.entrySet()) {
            final String contextPath = portletSessionEntry.getKey();
            final PortletSession portletSession = portletSessionEntry.getValue();
            try {
                portletSession.invalidate();
            } catch (IllegalStateException e) {
                this.logger.info(
                        "PortletSession with id '"
                                + portletSession.getId()
                                + "' for context '"
                                + contextPath
                                + "' has already been invalidated.");
            } catch (Exception e) {
                this.logger.warn(
                        "Failed to invalidate PortletSession with id '"
                                + portletSession.getId()
                                + "' for context '"
                                + contextPath
                                + "'",
                        e);
            }
        }
    }
1210111
protected void configureEndpointAccessToDenyUndefined(final HttpSecurity http,
                                                          final ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry requests) {
        val endpoints = casProperties.getMonitor().getEndpoints().getEndpoint().keySet();
        val endpointDefaults = casProperties.getMonitor().getEndpoints().getDefaultEndpointProperties();
        pathMappedEndpoints.forEach(endpoint -> {
            val rootPath = endpoint.getRootPath();
            if (endpoints.contains(rootPath)) {
                LOGGER.trace("Endpoint security is defined for endpoint [{}]", rootPath);
            } else {
                val defaultAccessRules = endpointDefaults.getAccess();
                LOGGER.trace("Endpoint security is NOT defined for endpoint [{}]. Using default security rules [{}]", rootPath, endpointDefaults);
                val endpointRequest = EndpointRequest.to(rootPath).excludingLinks();
                defaultAccessRules.forEach(Unchecked.consumer(access ->
                    configureEndpointAccess(http, requests, access, endpointDefaults, endpointRequest)));
            }
        });
    }
128183
@Override
    public void notifyWebAppSecurityConfigChanged(WebAppSecurityConfigChangeEvent event) {
        List<String> attributes = event.getModifiedAttributeList();
        if (isAppRestartRequired(attributes)) {
            recycleApplications();
        }
    }
1301210
@Override
    public void onApplicationEvent(@Nonnull ApplicationEvent event) {
        if (event instanceof ContextRefreshedEvent) {
            synchronized (this) {
                ApplicationContext applicationContext = ((ContextRefreshedEvent) event).getApplicationContext();
                setApplicationContext(new WebApplicationContextAdapter(applicationContext, this.servletConfig.getServletContext()));

                // Configure the MVC infrastructure
                configureMultipartResolver();
                configureExceptionResolvers();
                configureHandlerAdapters();
                registerCustomArgumentResolvers();
                configureHandlerMappings();
                addNebaViewResolver();

                // Picks up the previously registered MVC infrastructure
                onRefresh(applicationContext);

                this.initialized = true;
            }
        }
    }
857123
private void addHttpSessionIdListener(HttpSessionIdListener listener, boolean securityCheckNeeded) throws SecurityException {
        if (securityCheckNeeded) {
            SecurityManager sm = System.getSecurityManager();
            if (sm != null) {
                sm.checkPermission(perm);
            }
        }
        
        ((IHttpSessionContext31)this.getSessionContext()).addHttpSessionIdListener(listener, name);
    }
594476
protected void initSecurityConstraint(XmlParser.Node node)
    {
        try
        {
            SecurityConstraint scBase = new SecurityConstraint();
            XmlParser.Node auths = node.get("auth-constraint");
            if (auths != null)
            {
                scBase.setAuthenticate(true);
                // auth-constraint
                Iterator iter = auths.iterator("role-name");
                while (iter.hasNext())
                {
                    String role = ((XmlParser.Node) iter.next()).toString(false, true);
                    scBase.addRole(role);
                }
            }
            XmlParser.Node data = node.get("user-data-constraint");
            if (data != null)
            {
                data = data.get("transport-guarantee");
                String guarantee = data.toString(false, true).toUpperCase();
                if (guarantee == null || guarantee.length() == 0 || "NONE".equals(guarantee))
                    scBase.setDataConstraint(SecurityConstraint.DC_NONE);
                else if ("INTEGRAL".equals(guarantee))
                    scBase.setDataConstraint(SecurityConstraint.DC_INTEGRAL);
                else if ("CONFIDENTIAL".equals(guarantee))
                    scBase.setDataConstraint(SecurityConstraint.DC_CONFIDENTIAL);
                else
                {
                    log.warn("Unknown user-data-constraint:" + guarantee);
                    scBase.setDataConstraint(SecurityConstraint.DC_CONFIDENTIAL);
                }
            }
            Iterator iter = node.iterator("web-resource-collection");
            while (iter.hasNext())
            {
                XmlParser.Node collection = (XmlParser.Node) iter.next();
                String name = collection.getString("web-resource-name", false, true);
                SecurityConstraint sc = (SecurityConstraint) scBase.clone();
                sc.setName(name);
                Iterator iter2 = collection.iterator("http-method");
                while (iter2.hasNext())
                    sc.addMethod(((XmlParser.Node) iter2.next()).toString(false, true));
                iter2 = collection.iterator("url-pattern");
                while (iter2.hasNext())
                {
                    String url = ((XmlParser.Node) iter2.next()).toString(false, true);
                    getWebApplicationContext().addSecurityConstraint(url, sc);
                }
            }
        }
        catch (CloneNotSupportedException e)
        {
            log.fatal(e);
        }
    }
1239201
public void setAllowedValues(java.util.Collection<String> allowedValues) {
        if (allowedValues == null) {
            this.allowedValues = null;
            return;
        }

        this.allowedValues = new com.amazonaws.internal.SdkInternalList<String>(allowedValues);
    }
197538
protected void processEvent (DEvent event)
    {
        // look up the target object
        DObject target = _objects.get(event.getTargetOid());
        if (target == null) {
            log.debug("Event target no longer exists", "event", event);
            return;
        }

        // check the event's permissions
        if (!target.checkPermissions(event)) {
            log.warning("Event failed permissions check", "event", event, "target", target);
            return;
        }

        if (dispatchEvent(event, target)) {
            // unless requested not to, notify any proxies
            target.notifyProxies(event);
        }
    }
708909
@Override
	public void handleRequest(final Request request) {
		if (isDisabled()) {
			// Protect against client-side tampering of disabled/read-only fields.
			return;
		}

		// Remember which client side tab we were on.
		String[] indicesStr = request.getParameterValues(getId());

		if (indicesStr != null && indicesStr.length > 0) {
			List<Integer> oldIndices = getActiveIndices();
			List<Integer> changes = new ArrayList<>(1);
			int[] indices = new int[indicesStr.length];

			if (Util.empty(indicesStr[0])) {
				// Special case - no tab selected
				if (getType() == TYPE_ACCORDION) {
					indices = null;
				} else {
					int idx = findFirstVisibleTab();
					indices = new int[idx];
				}
			} else {
				// Normal case - one or more tabs selected
				for (int i = 0; i < indices.length; i++) {
					int clientIndex = Integer.parseInt(indicesStr[i]);
					int idx = clientIndexToTabIndex(clientIndex);
					indices[i] = idx;

					if (!oldIndices.contains(idx)) {
						// Check for a server mode tab and set focus
						WTab tab = getTab(idx);
						if (TabMode.SERVER.equals(tab.getMode()) && UIContextHolder.getCurrent().getFocussed() == null) {
							tab.setFocussed();
						}
						changes.add(idx);
					}
				}
			}

			setActiveIndices(indices);

			// Invoke action if tab selection has changed
			final Action action = getActionOnChange();

			if (action != null && !changes.isEmpty()) {
				final ActionEvent event = new ActionEvent(this, changes.toString(), null);

				Runnable later = new Runnable() {
					@Override
					public void run() {
						action.execute(event);
					}
				};

				invokeLater(later);
			}
		}

		String showHeadOnlyStr = request.getParameter(getId() + ".showHeadOnly");

		if (showHeadOnlyStr != null) {
			boolean showHeadOnly = "true".equals(showHeadOnlyStr);
			setShowHeadOnly(showHeadOnly);
		}
	}
614040
public void onApplicationEvent(ApplicationEvent event) {

        // All events we care about are subtypes of ClientSecurityEvent
        if( event instanceof ClientSecurityEvent ) {
            Authentication authentication = (Authentication) event.getSource();

            if( logger.isDebugEnabled() ) {
                logger.debug( "RECEIVED ClientSecurityEvent: " + event );
                logger.debug( "Authentication token: " + authentication );
            }

            // Note that we need to inspect the new authentication token and see if it is
            // NO_AUTHENTICATION. If so, then we need to use null instead. This little
            // dance is required because the source of an event can't actually be null.

            if( authentication == ClientSecurityEvent.NO_AUTHENTICATION ) {
                if( logger.isDebugEnabled() ) {
                    logger.debug( "Converted NO_AUTHENTICATION to null" );
                }
                authentication = null;
            }

            // And dispatch according to the event type.

            if( event instanceof AuthenticationEvent ) {
                broadcastAuthentication( authentication );
            } else if( event instanceof LoginEvent ) {
                broadcastLogin( authentication );
            } else if( event instanceof LogoutEvent ) {
                broadcastLogout( authentication );
            } else {
                if( logger.isDebugEnabled() ) {
                    logger.debug( "Unsupported event not processed" );
                }
            }
        }
    }
1053566
@Override
    public void configurationEvent(ConfigurationEvent event) {
        if (event.getType() == ConfigurationEvent.CM_UPDATED && pids.contains(event.getPid())) {
            populateDestinationPermissions();
            runtimeSecurityService.modifyMessagingServices(this);
        }

    }
122461
@EventListener
    public void handleCasAuthenticationTransactionFailureEvent(final CasAuthenticationTransactionFailureEvent event) {
        if (this.casEventRepository != null) {
            val dto = prepareCasEvent(event);
            dto.setPrincipalId(event.getCredential().getId());
            dto.putEventId(CasAuthenticationPolicyFailureEvent.class.getSimpleName());
            this.casEventRepository.save(dto);
        }
    }
375032
protected void handleRequestValue(final BigDecimal value, final boolean valid, final String text) {
		// As setData() clears the text value (if valid), this must be called first so it can be set after
		setData(value);
		NumberFieldModel model = getOrCreateComponentModel();
		model.validNumber = valid;
		model.text = text;
	}