idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
17,500 | public static Pattern createPattern ( final String pattern , final int flags ) { if ( pattern == null ) { LOGGER . debug ( "Pattern cannot be null" ) ; return MATCH_NOTHING_PATTERN ; } try { return Pattern . compile ( pattern , flags ) ; } catch ( final PatternSyntaxException exception ) { LOGGER . debug ( "Pattern [{}... | Creates the pattern with the given flags . |
17,501 | public static boolean matches ( final Pattern pattern , final String value , final boolean completeMatch ) { val matcher = pattern . matcher ( value ) ; LOGGER . debug ( "Matching value [{}] against pattern [{}]" , value , pattern . pattern ( ) ) ; if ( completeMatch ) { return matcher . matches ( ) ; } return matcher ... | Matches boolean . |
17,502 | public static boolean find ( final String pattern , final String string ) { return createPattern ( pattern , Pattern . CASE_INSENSITIVE ) . matcher ( string ) . find ( ) ; } | Attempts to find the next sub - sequence of the input sequence that matches the pattern . |
17,503 | private static void verifyRegisteredServiceProperties ( final RegisteredService registeredService , final Service service ) { if ( registeredService == null ) { val msg = String . format ( "Service [%s] is not found in service registry." , service . getId ( ) ) ; LOGGER . warn ( msg ) ; throw new UnauthorizedServiceExc... | Ensure that the service is found and enabled in the service registry . |
17,504 | protected Credential getServiceCredentialsFromRequest ( final WebApplicationService service , final HttpServletRequest request ) { val pgtUrl = request . getParameter ( CasProtocolConstants . PARAMETER_PROXY_CALLBACK_URL ) ; if ( StringUtils . isNotBlank ( pgtUrl ) ) { try { val registeredService = serviceValidateConfi... | Overrideable method to determine which credentials to use to grant a proxy granting ticket . Default is to use the pgtUrl . |
17,505 | protected void initBinder ( final HttpServletRequest request , final ServletRequestDataBinder binder ) { if ( serviceValidateConfigurationContext . isRenewEnabled ( ) ) { binder . setRequiredFields ( CasProtocolConstants . PARAMETER_RENEW ) ; } } | Initialize the binder with the required fields . |
17,506 | public TicketGrantingTicket handleProxyGrantingTicketDelivery ( final String serviceTicketId , final Credential credential ) throws AuthenticationException , AbstractTicketException { val serviceTicket = serviceValidateConfigurationContext . getCentralAuthenticationService ( ) . getTicket ( serviceTicketId , ServiceTic... | Handle proxy granting ticket delivery . |
17,507 | protected ModelAndView handleTicketValidation ( final HttpServletRequest request , final WebApplicationService service , final String serviceTicketId ) { var proxyGrantingTicketId = ( TicketGrantingTicket ) null ; val serviceCredential = getServiceCredentialsFromRequest ( service , request ) ; if ( serviceCredential !=... | Handle ticket validation model and view . |
17,508 | protected Assertion validateServiceTicket ( final WebApplicationService service , final String serviceTicketId ) { return serviceValidateConfigurationContext . getCentralAuthenticationService ( ) . validateServiceTicket ( serviceTicketId , service ) ; } | Validate service ticket assertion . |
17,509 | private boolean validateAssertion ( final HttpServletRequest request , final String serviceTicketId , final Assertion assertion , final Service service ) { for ( val spec : serviceValidateConfigurationContext . getValidationSpecifications ( ) ) { spec . reset ( ) ; val binder = new ServletRequestDataBinder ( spec , "va... | Validate assertion . |
17,510 | private ModelAndView generateErrorView ( final String code , final Object [ ] args , final HttpServletRequest request , final WebApplicationService service ) { val modelAndView = serviceValidateConfigurationContext . getValidationViewFactory ( ) . getModelAndView ( request , false , service , getClass ( ) ) ; val conve... | Generate error view . |
17,511 | private ModelAndView generateSuccessView ( final Assertion assertion , final String proxyIou , final WebApplicationService service , final HttpServletRequest request , final Optional < MultifactorAuthenticationProvider > contextProvider , final TicketGrantingTicket proxyGrantingTicket ) { val modelAndView = serviceVali... | Generate the success view . The result will contain the assertion and the proxy iou . |
17,512 | protected void enforceTicketValidationAuthorizationFor ( final HttpServletRequest request , final Service service , final Assertion assertion ) { val authorizers = serviceValidateConfigurationContext . getValidationAuthorizers ( ) . getAuthorizers ( ) ; for ( val a : authorizers ) { try { a . authorize ( request , serv... | Enforce ticket validation authorization for . |
17,513 | private static int getTimeToLive ( final Ticket ticket ) { val expTime = ticket . getExpirationPolicy ( ) . getTimeToLive ( ) . intValue ( ) ; if ( TimeUnit . SECONDS . toDays ( expTime ) >= MAX_EXP_TIME_IN_DAYS ) { LOGGER . warn ( "Any expiration time larger than [{}] days in seconds is considered absolute (as in a Un... | Get the expiration policy value of the ticket in seconds . |
17,514 | protected int deleteChildren ( final TicketGrantingTicket ticket ) { val count = new AtomicInteger ( 0 ) ; val services = ticket . getServices ( ) ; if ( services != null && ! services . isEmpty ( ) ) { services . keySet ( ) . forEach ( ticketId -> { if ( deleteSingleTicket ( ticketId ) ) { LOGGER . debug ( "Removed ti... | Delete TGT s service tickets . |
17,515 | protected String encodeTicketId ( final String ticketId ) { if ( ! isCipherExecutorEnabled ( ) ) { LOGGER . trace ( MESSAGE ) ; return ticketId ; } if ( StringUtils . isBlank ( ticketId ) ) { return ticketId ; } val encodedId = DigestUtils . sha512 ( ticketId ) ; LOGGER . debug ( "Encoded original ticket id [{}] to [{}... | Encode ticket id into a SHA - 512 . |
17,516 | protected Ticket encodeTicket ( final Ticket ticket ) { if ( ! isCipherExecutorEnabled ( ) ) { LOGGER . trace ( MESSAGE ) ; return ticket ; } if ( ticket == null ) { LOGGER . debug ( "Ticket passed is null and cannot be encoded" ) ; return null ; } LOGGER . debug ( "Encoding ticket [{}]" , ticket ) ; val encodedTicketO... | Encode ticket . |
17,517 | protected Ticket decodeTicket ( final Ticket result ) { if ( ! isCipherExecutorEnabled ( ) ) { LOGGER . trace ( MESSAGE ) ; return result ; } if ( result == null ) { LOGGER . warn ( "Ticket passed is null and cannot be decoded" ) ; return null ; } if ( ! result . getClass ( ) . isAssignableFrom ( EncodedTicket . class ... | Decode ticket . |
17,518 | protected Map < String , List < Object > > getPrincipalAttributesForPrincipal ( final Principal principal , final Map < String , List < Object > > principalAttributes ) { return principalAttributes ; } | Gets principal attributes for principal . |
17,519 | private List < Resource > scanForConfigurationResources ( final File config , final List < String > profiles ) { val possibleFiles = getAllPossibleExternalConfigDirFilenames ( config , profiles ) ; return possibleFiles . stream ( ) . filter ( File :: exists ) . filter ( File :: isFile ) . map ( FileSystemResource :: ne... | Get all possible configuration files for config directory that actually exist as files . |
17,520 | private PropertySource < ? > loadSettingsByApplicationProfiles ( final Environment environment , final File config ) { val profiles = ConfigurationPropertiesLoaderFactory . getApplicationProfiles ( environment ) ; val resources = scanForConfigurationResources ( config , profiles ) ; val composite = new CompositePropert... | Property files processed in order of non - profiles first and then profiles and profiles are first to last with properties in the last profile overriding properties in previous profiles or non - profiles . |
17,521 | protected void handleUnmappedAttribute ( final Map < String , List < Object > > attributesToRelease , final String attributeName , final Object attributeValue ) { LOGGER . debug ( "Found attribute [{}] that is not defined in pattern definitions" , attributeName ) ; if ( excludeUnmappedAttributes ) { LOGGER . debug ( "E... | Handle unmapped attribute . |
17,522 | protected Collection < Pattern > createPatternForMappedAttribute ( final String attributeName ) { val matchingPattern = patterns . get ( attributeName ) . toString ( ) ; val pattern = RegexUtils . createPattern ( matchingPattern , this . caseInsensitive ? Pattern . CASE_INSENSITIVE : 0 ) ; LOGGER . debug ( "Created pat... | Create pattern for mapped attribute pattern . |
17,523 | protected void collectAttributeWithFilteredValues ( final Map < String , List < Object > > attributesToRelease , final String attributeName , final List < Object > filteredValues ) { attributesToRelease . put ( attributeName , filteredValues ) ; } | Collect attribute with filtered values . |
17,524 | protected Predicate < Map . Entry < String , List < Object > > > filterProvidedGivenAttributes ( ) { return entry -> { val attributeName = entry . getKey ( ) ; val attributeValue = entry . getValue ( ) ; LOGGER . debug ( "Received attribute [{}] with value(s) [{}]" , attributeName , attributeValue ) ; return attributeV... | Filter provided given attributes predicate . |
17,525 | protected List < Object > filterAttributeValuesByPattern ( final Set < Object > attributeValues , final Pattern pattern ) { return attributeValues . stream ( ) . filter ( v -> RegexUtils . matches ( pattern , v . toString ( ) , completeMatch ) ) . collect ( Collectors . toList ( ) ) ; } | Filter attribute values by pattern and return the list . |
17,526 | public AmazonDynamoDB createAmazonDynamoDb ( final AbstractDynamoDbProperties props ) { if ( props . isLocalInstance ( ) ) { LOGGER . debug ( "Creating DynamoDb standard client with endpoint [{}] and region [{}]" , props . getEndpoint ( ) , props . getRegion ( ) ) ; val endpoint = new AwsClientBuilder . EndpointConfigu... | Create amazon dynamo db instance . |
17,527 | public static ModelAndView writeError ( final HttpServletResponse response , final String error ) { val model = CollectionUtils . wrap ( OAuth20Constants . ERROR , error ) ; val mv = new ModelAndView ( new MappingJackson2JsonView ( MAPPER ) , ( Map ) model ) ; mv . setStatus ( HttpStatus . BAD_REQUEST ) ; response . se... | Write to the output this error . |
17,528 | public static OAuthRegisteredService getRegisteredOAuthServiceByRedirectUri ( final ServicesManager servicesManager , final String redirectUri ) { return getRegisteredOAuthServiceByPredicate ( servicesManager , s -> s . matches ( redirectUri ) ) ; } | Gets registered oauth service by redirect uri . |
17,529 | public static Map < String , Object > getRequestParameters ( final Collection < String > attributes , final HttpServletRequest context ) { return attributes . stream ( ) . filter ( a -> StringUtils . isNotBlank ( context . getParameter ( a ) ) ) . map ( m -> { val values = context . getParameterValues ( m ) ; val value... | Gets attributes . |
17,530 | public static Collection < String > getRequestedScopes ( final HttpServletRequest context ) { val map = getRequestParameters ( CollectionUtils . wrap ( OAuth20Constants . SCOPE ) , context ) ; if ( map == null || map . isEmpty ( ) ) { return new ArrayList < > ( 0 ) ; } return ( Collection < String > ) map . get ( OAuth... | Gets requested scopes . |
17,531 | public static String casOAuthCallbackUrl ( final String serverPrefixUrl ) { return serverPrefixUrl . concat ( OAuth20Constants . BASE_OAUTH20_URL + '/' + OAuth20Constants . CALLBACK_AUTHORIZE_URL ) ; } | CAS oauth callback url . |
17,532 | public static boolean isResponseModeTypeFormPost ( final OAuthRegisteredService registeredService , final OAuth20ResponseModeTypes responseType ) { return responseType == OAuth20ResponseModeTypes . FORM_POST || StringUtils . equalsIgnoreCase ( "post" , registeredService . getResponseType ( ) ) ; } | Is response mode type form post? |
17,533 | public static OAuth20ResponseTypes getResponseType ( final J2EContext context ) { val responseType = context . getRequestParameter ( OAuth20Constants . RESPONSE_TYPE ) ; val type = Arrays . stream ( OAuth20ResponseTypes . values ( ) ) . filter ( t -> t . getType ( ) . equalsIgnoreCase ( responseType ) ) . findFirst ( )... | Gets response type . |
17,534 | public static OAuth20ResponseModeTypes getResponseModeType ( final J2EContext context ) { val responseType = context . getRequestParameter ( OAuth20Constants . RESPONSE_MODE ) ; val type = Arrays . stream ( OAuth20ResponseModeTypes . values ( ) ) . filter ( t -> t . getType ( ) . equalsIgnoreCase ( responseType ) ) . f... | Gets response mode type . |
17,535 | public static boolean isAuthorizedResponseTypeForService ( final J2EContext context , final OAuthRegisteredService registeredService ) { val responseType = context . getRequestParameter ( OAuth20Constants . RESPONSE_TYPE ) ; if ( registeredService . getSupportedResponseTypes ( ) != null && ! registeredService . getSupp... | Is authorized response type for service? |
17,536 | public static Set < String > parseRequestScopes ( final HttpServletRequest context ) { val parameterValues = context . getParameter ( OAuth20Constants . SCOPE ) ; if ( StringUtils . isBlank ( parameterValues ) ) { return new HashSet < > ( 0 ) ; } return CollectionUtils . wrapSet ( parameterValues . split ( " " ) ) ; } | Parse request scopes set . |
17,537 | public static String getServiceRequestHeaderIfAny ( final HttpServletRequest context ) { if ( context == null ) { return null ; } var id = context . getHeader ( CasProtocolConstants . PARAMETER_SERVICE ) ; if ( StringUtils . isBlank ( id ) ) { id = context . getHeader ( "X-" . concat ( CasProtocolConstants . PARAMETER_... | Gets service request header if any . |
17,538 | public static boolean checkCallbackValid ( final RegisteredService registeredService , final String redirectUri ) { val registeredServiceId = registeredService . getServiceId ( ) ; LOGGER . debug ( "Found: [{}] vs redirectUri: [{}]" , registeredService , redirectUri ) ; if ( ! redirectUri . matches ( registeredServiceI... | Check if the callback url is valid . |
17,539 | public static boolean checkClientSecret ( final OAuthRegisteredService registeredService , final String clientSecret ) { LOGGER . debug ( "Found: [{}] in secret check" , registeredService ) ; if ( StringUtils . isBlank ( registeredService . getClientSecret ( ) ) ) { LOGGER . debug ( "The client secret is not defined fo... | Check the client secret . |
17,540 | public static boolean checkResponseTypes ( final String type , final OAuth20ResponseTypes ... expectedTypes ) { LOGGER . debug ( "Response type: [{}]" , type ) ; val checked = Stream . of ( expectedTypes ) . anyMatch ( t -> OAuth20Utils . isResponseType ( type , t ) ) ; if ( ! checked ) { LOGGER . error ( "Unsupported ... | Check the response type against expected response types . |
17,541 | public static String getClientIdFromAuthenticatedProfile ( final CommonProfile profile ) { if ( profile . containsAttribute ( OAuth20Constants . CLIENT_ID ) ) { val attribute = profile . getAttribute ( OAuth20Constants . CLIENT_ID ) ; return CollectionUtils . toCollection ( attribute , ArrayList . class ) . get ( 0 ) .... | Gets client id from authenticated profile . |
17,542 | public static WSFederationRequest of ( final HttpServletRequest request ) { val wtrealm = request . getParameter ( WSFederationConstants . WTREALM ) ; val wreply = request . getParameter ( WSFederationConstants . WREPLY ) ; val wreq = request . getParameter ( WSFederationConstants . WREQ ) ; val wctx = request . getPar... | Create federation request . |
17,543 | private Stream < String > getKeysStream ( ) { val cursor = client . getConnectionFactory ( ) . getConnection ( ) . scan ( ScanOptions . scanOptions ( ) . match ( getPatternTicketRedisKey ( ) ) . count ( SCAN_COUNT ) . build ( ) ) ; return StreamSupport . stream ( Spliterators . spliteratorUnknownSize ( cursor , Spliter... | Get a stream of all CAS - related keys from Redis DB . |
17,544 | protected Principal getAccessTokenAuthenticationPrincipal ( final AccessToken accessToken , final J2EContext context , final RegisteredService registeredService ) { val currentPrincipal = accessToken . getAuthentication ( ) . getPrincipal ( ) ; LOGGER . debug ( "Preparing user profile response based on CAS principal [{... | Gets access token authentication principal . |
17,545 | protected void finalizeProfileResponse ( final AccessToken accessTokenTicket , final Map < String , Object > map , final Principal principal ) { val service = accessTokenTicket . getService ( ) ; val registeredService = servicesManager . findServiceBy ( service ) ; if ( registeredService instanceof OAuthRegisteredServi... | Finalize profile response . |
17,546 | public static Map loadYamlProperties ( final Resource ... resource ) { val factory = new YamlPropertiesFactoryBean ( ) ; factory . setResolutionMethod ( YamlProcessor . ResolutionMethod . OVERRIDE ) ; factory . setResources ( resource ) ; factory . setSingleton ( true ) ; factory . afterPropertiesSet ( ) ; return facto... | Load yaml properties map . |
17,547 | protected String grantServiceTicket ( final String ticketGrantingTicket , final Service service , final AuthenticationResult authenticationResult ) { val ticket = centralAuthenticationService . grantServiceTicket ( ticketGrantingTicket , service , authenticationResult ) ; LOGGER . debug ( "Generated service ticket [{}]... | Grant service ticket service ticket . |
17,548 | protected CommonProfile buildUserProfile ( final TokenCredentials tokenCredentials , final WebContext webContext , final AccessToken accessToken ) { val userProfile = new CommonProfile ( true ) ; val authentication = accessToken . getAuthentication ( ) ; val principal = authentication . getPrincipal ( ) ; userProfile .... | Build user profile common profile . |
17,549 | public View getView ( final HttpServletRequest request , final boolean isSuccess , final WebApplicationService service , final Class ownerClass ) { val type = getValidationResponseType ( request , service ) ; if ( type == ValidationResponseType . JSON ) { return getSingleInstanceView ( ServiceValidationViewTypes . JSON... | Gets view . |
17,550 | public ModelAndView getModelAndView ( final HttpServletRequest request , final boolean isSuccess , final WebApplicationService service , final Class ownerClass ) { val view = getView ( request , isSuccess , service , ownerClass ) ; return new ModelAndView ( view ) ; } | Gets model and view . |
17,551 | private static ValidationResponseType getValidationResponseType ( final HttpServletRequest request , final WebApplicationService service ) { val format = request . getParameter ( CasProtocolConstants . PARAMETER_FORMAT ) ; final Function < String , ValidationResponseType > func = FunctionUtils . doIf ( StringUtils :: i... | Gets validation response type . |
17,552 | public static LocalDateTime localDateTimeOf ( final String value ) { var result = ( LocalDateTime ) null ; try { result = LocalDateTime . parse ( value , DateTimeFormatter . ISO_LOCAL_DATE_TIME ) ; } catch ( final Exception e ) { result = null ; } if ( result == null ) { try { result = LocalDateTime . parse ( value , D... | Parse the given value as a local datetime . |
17,553 | public static LocalDateTime localDateTimeOf ( final long time ) { return LocalDateTime . ofInstant ( Instant . ofEpochMilli ( time ) , ZoneId . systemDefault ( ) ) ; } | Local date time of local date time . |
17,554 | public static ZonedDateTime zonedDateTimeOf ( final String value ) { try { return ZonedDateTime . parse ( value ) ; } catch ( final Exception e ) { return null ; } } | Parse the given value as a zoned datetime . |
17,555 | public static ZonedDateTime zonedDateTimeOf ( final long time , final ZoneId zoneId ) { return ZonedDateTime . ofInstant ( Instant . ofEpochMilli ( time ) , zoneId ) ; } | Utility for creating a ZonedDateTime object from a millisecond timestamp . |
17,556 | public static ZonedDateTime zonedDateTimeOf ( final Calendar time ) { return ZonedDateTime . ofInstant ( time . toInstant ( ) , time . getTimeZone ( ) . toZoneId ( ) ) ; } | Gets ZonedDateTime for Calendar . |
17,557 | public static Date dateOf ( final LocalDate time ) { return Date . from ( time . atStartOfDay ( ZoneOffset . UTC ) . toInstant ( ) ) ; } | Date of local date . |
17,558 | public static ZonedDateTime convertToZonedDateTime ( final String value ) { val dt = DateTimeUtils . zonedDateTimeOf ( value ) ; if ( dt != null ) { return dt ; } val lt = DateTimeUtils . localDateTimeOf ( value ) ; return DateTimeUtils . zonedDateTimeOf ( lt . atZone ( ZoneOffset . UTC ) ) ; } | Convert to zoned date time . |
17,559 | public static TimeUnit toTimeUnit ( final ChronoUnit tu ) { if ( tu == null ) { return null ; } switch ( tu ) { case DAYS : return TimeUnit . DAYS ; case HOURS : return TimeUnit . HOURS ; case MINUTES : return TimeUnit . MINUTES ; case SECONDS : return TimeUnit . SECONDS ; case MICROS : return TimeUnit . MICROSECONDS ;... | To time unit time unit . |
17,560 | protected boolean throttleRequest ( final HttpServletRequest request , final HttpServletResponse response ) { return configurationContext . getThrottledRequestExecutor ( ) != null && configurationContext . getThrottledRequestExecutor ( ) . throttle ( request , response ) ; } | Is request throttled . |
17,561 | protected boolean shouldResponseBeRecordedAsFailure ( final HttpServletResponse response ) { val status = response . getStatus ( ) ; return status != HttpStatus . SC_CREATED && status != HttpStatus . SC_OK && status != HttpStatus . SC_MOVED_TEMPORARILY ; } | Should response be recorded as failure boolean . |
17,562 | protected String getUsernameParameterFromRequest ( final HttpServletRequest request ) { return request . getParameter ( StringUtils . defaultString ( configurationContext . getUsernameParameter ( ) , "username" ) ) ; } | Construct username from the request . |
17,563 | protected Date getFailureInRangeCutOffDate ( ) { val cutoff = ZonedDateTime . now ( ZoneOffset . UTC ) . minusSeconds ( configurationContext . getFailureRangeInSeconds ( ) ) ; return DateTimeUtils . timestampOf ( cutoff ) ; } | Gets failure in range cut off date . |
17,564 | protected void recordAuditAction ( final HttpServletRequest request , final String actionName ) { val userToUse = getUsernameParameterFromRequest ( request ) ; val clientInfo = ClientInfoHolder . getClientInfo ( ) ; val resource = StringUtils . defaultString ( request . getParameter ( CasProtocolConstants . PARAMETER_S... | Records an audit action . |
17,565 | private AuthnStatement buildAuthnStatement ( final Object casAssertion , final RequestAbstractType authnRequest , final SamlRegisteredServiceServiceProviderMetadataFacade adaptor , final SamlRegisteredService service , final String binding , final MessageContext messageContext , final HttpServletRequest request ) throw... | Creates an authentication statement for the current request . |
17,566 | protected SubjectLocality buildSubjectLocality ( final Object assertion , final RequestAbstractType authnRequest , final SamlRegisteredServiceServiceProviderMetadataFacade adaptor , final String binding ) throws SamlException { val subjectLocality = newSamlObject ( SubjectLocality . class ) ; val hostAddress = InetAddr... | Build subject locality subject locality . |
17,567 | public CasServerProfile getProfile ( ) { val profile = new CasServerProfile ( ) ; profile . setRegisteredServiceTypesSupported ( locateRegisteredServiceTypesSupported ( ) ) ; profile . setRegisteredServiceTypes ( locateRegisteredServiceTypesActive ( ) ) ; profile . setMultifactorAuthenticationProviderTypesSupported ( l... | Gets profile . |
17,568 | public static org . apereo . cas . web . UrlValidator getInstance ( ) { if ( INSTANCE == null ) { INSTANCE = new SimpleUrlValidator ( UrlValidator . getInstance ( ) , DomainValidator . getInstance ( ) ) ; } return INSTANCE ; } | Gets a static instance to be used internal only . |
17,569 | public void handleApplicationReadyEvent ( final ApplicationReadyEvent event ) { AsciiArtUtils . printAsciiArtInfo ( LOGGER , "READY" , StringUtils . EMPTY ) ; LOGGER . info ( "Ready to process requests @ [{}]" , DateTimeUtils . zonedDateTimeOf ( event . getTimestamp ( ) ) ) ; } | Handle application ready event . |
17,570 | private static URI [ ] getDistributionPoints ( final X509Certificate cert ) { try { val points = new ExtensionReader ( cert ) . readCRLDistributionPoints ( ) ; val urls = new ArrayList < URI > ( ) ; if ( points != null ) { points . stream ( ) . map ( DistributionPoint :: getDistributionPoint ) . filter ( Objects :: non... | Gets the distribution points . |
17,571 | protected Event doExecute ( final RequestContext context ) { try { val request = WebUtils . getHttpServletRequestFromExternalWebflowContext ( context ) ; val wa = request . getParameter ( WA ) ; if ( StringUtils . isNotBlank ( wa ) && wa . equalsIgnoreCase ( WSIGNIN ) ) { wsFederationResponseValidator . validateWsFeder... | Executes the webflow action . |
17,572 | public boolean isValid ( ) { return StringUtils . isNotBlank ( getMetadata ( ) ) && StringUtils . isNotBlank ( getSigningCertificate ( ) ) && StringUtils . isNotBlank ( getSigningKey ( ) ) && StringUtils . isNotBlank ( getEncryptionCertificate ( ) ) && StringUtils . isNotBlank ( getEncryptionKey ( ) ) ; } | Is this document valid and has any of the fields? |
17,573 | public String getSigningCertificateDecoded ( ) { if ( EncodingUtils . isBase64 ( signingCertificate ) ) { return EncodingUtils . decodeBase64ToString ( signingCertificate ) ; } return signingCertificate ; } | Gets signing certificate decoded . |
17,574 | public String getEncryptionCertificateDecoded ( ) { if ( EncodingUtils . isBase64 ( encryptionCertificate ) ) { return EncodingUtils . decodeBase64ToString ( encryptionCertificate ) ; } return encryptionCertificate ; } | Gets encryption certificate decoded . |
17,575 | public String getMetadataDecoded ( ) { if ( EncodingUtils . isBase64 ( metadata ) ) { return EncodingUtils . decodeBase64ToString ( metadata ) ; } return metadata ; } | Gets metadata decoded . |
17,576 | protected ModelAndView handleRequestInternal ( final HttpServletRequest request , final HttpServletResponse response ) throws Exception { for ( val delegate : this . delegates ) { if ( delegate . canHandle ( request , response ) ) { return delegate . handleRequestInternal ( request , response ) ; } } return generateErr... | Handles the request . Ask all delegates if they can handle the current request . The first to answer true is elected as the delegate that will process the request . If no controller answers true we redirect to the error page . |
17,577 | protected Assertion getAssertionFrom ( final Map < String , Object > model ) { return ( Assertion ) model . get ( CasViewConstants . MODEL_ATTRIBUTE_NAME_ASSERTION ) ; } | Gets the assertion from the model . |
17,578 | protected String getErrorCodeFrom ( final Map < String , Object > model ) { return model . get ( CasViewConstants . MODEL_ATTRIBUTE_NAME_ERROR_CODE ) . toString ( ) ; } | Gets error code from . |
17,579 | protected String getErrorDescriptionFrom ( final Map < String , Object > model ) { return model . get ( CasViewConstants . MODEL_ATTRIBUTE_NAME_ERROR_DESCRIPTION ) . toString ( ) ; } | Gets error description from . |
17,580 | protected String getProxyGrantingTicketIou ( final Map < String , Object > model ) { return ( String ) model . get ( CasViewConstants . MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET_IOU ) ; } | Gets the PGT - IOU from the model . |
17,581 | protected Map < String , Object > getModelAttributes ( final Map < String , Object > model ) { return ( Map < String , Object > ) model . get ( CasProtocolConstants . VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_ATTRIBUTES ) ; } | Gets model attributes . |
17,582 | protected Map < String , List < Object > > getPrincipalAttributesAsMultiValuedAttributes ( final Map < String , Object > model ) { return getPrincipal ( model ) . getAttributes ( ) ; } | Gets principal attributes . Single - valued attributes are converted to a collection so the review can easily loop through all . |
17,583 | protected Service getServiceFrom ( final Map < String , Object > model ) { return ( Service ) model . get ( CasViewConstants . MODEL_ATTRIBUTE_NAME_SERVICE ) ; } | Gets validated service from the model . |
17,584 | protected Collection < Authentication > getChainedAuthentications ( final Map < String , Object > model ) { val assertion = getAssertionFrom ( model ) ; val chainedAuthentications = assertion . getChainedAuthentications ( ) ; return chainedAuthentications . stream ( ) . limit ( chainedAuthentications . size ( ) - 1 ) .... | Gets chained authentications . Note that the last index in the list always describes the primary authentication event . All others in the chain should denote proxies . Per the CAS protocol when authentication has proceeded through multiple proxies the order in which the proxies were traversed MUST be reflected in the r... |
17,585 | protected void putIntoModel ( final Map < String , Object > model , final String key , final Object value ) { LOGGER . trace ( "Adding attribute [{}] into the view model for [{}] with value [{}]" , key , getClass ( ) . getSimpleName ( ) , value ) ; model . put ( key , value ) ; } | Put into model . |
17,586 | protected Map < String , List < Object > > getCasProtocolAuthenticationAttributes ( final Map < String , Object > model , final RegisteredService registeredService ) { val authn = getPrimaryAuthenticationFrom ( model ) ; val assertion = getAssertionFrom ( model ) ; return authenticationAttributeReleasePolicy . getAuthe... | Put cas authentication attributes into model . |
17,587 | protected Map prepareViewModelWithAuthenticationPrincipal ( final Map < String , Object > model ) { putIntoModel ( model , CasViewConstants . MODEL_ATTRIBUTE_NAME_PRINCIPAL , getPrincipal ( model ) ) ; putIntoModel ( model , CasViewConstants . MODEL_ATTRIBUTE_NAME_CHAINED_AUTHENTICATIONS , getChainedAuthentications ( m... | Prepare view model with authentication principal . |
17,588 | protected void prepareCasResponseAttributesForViewModel ( final Map < String , Object > model ) { val service = authenticationRequestServiceSelectionStrategies . resolveService ( getServiceFrom ( model ) ) ; val registeredService = this . servicesManager . findServiceBy ( service ) ; val principalAttributes = getCasPri... | Prepare cas response attributes for view model . |
17,589 | protected Map < String , List < Object > > getCasPrincipalAttributes ( final Map < String , Object > model , final RegisteredService registeredService ) { return getPrincipalAttributesAsMultiValuedAttributes ( model ) ; } | Put cas principal attributes into model . |
17,590 | protected void putCasResponseAttributesIntoModel ( final Map < String , Object > model , final Map < String , Object > attributes , final RegisteredService registeredService , final CasProtocolAttributesRenderer attributesRenderer ) { LOGGER . trace ( "Beginning to encode attributes for the response" ) ; val encodedAtt... | Put cas response attributes into model . |
17,591 | @ View ( name = "by_when_action_was_performed" , map = "function(doc) { if(doc.whenActionWasPerformed) { emit(doc.whenActionWasPerformed, doc) } }" ) public List < CouchDbAuditActionContext > findAuditRecordsSince ( final LocalDate localDate ) { return db . queryView ( createQuery ( "by_when_action_was_performed" ) . s... | Find audit records since + localDate + . |
17,592 | @ View ( name = "by_throttle_params" , map = "classpath:CouchDbAuditActionContext_by_throttle_params.js" ) public List < CouchDbAuditActionContext > findByThrottleParams ( final String remoteAddress , final String username , final String failureCode , final String applicationCode , final LocalDateTime cutoffTime ) { va... | Find audit records for authentication throttling . |
17,593 | protected Map < String , Serializable > buildTicketProperties ( final J2EContext webContext ) { val properties = new HashMap < String , Serializable > ( ) ; val themeParamName = casProperties . getTheme ( ) . getParamName ( ) ; val localParamName = casProperties . getLocale ( ) . getParamName ( ) ; properties . put ( t... | Build the ticket properties . |
17,594 | protected Service restoreDelegatedAuthenticationRequest ( final RequestContext requestContext , final WebContext webContext , final TransientSessionTicket ticket ) { val service = ticket . getService ( ) ; LOGGER . trace ( "Restoring requested service [{}] back in the authentication flow" , service ) ; WebUtils . putSe... | Restore the information saved in the ticket and return the service . |
17,595 | protected TransientSessionTicket retrieveSessionTicketViaClientId ( final WebContext webContext , final String clientId ) { val ticket = this . ticketRegistry . getTicket ( clientId , TransientSessionTicket . class ) ; if ( ticket == null ) { LOGGER . error ( "Delegated client identifier cannot be located in the authen... | Retrieve session ticket via client id . |
17,596 | protected String getDelegatedClientId ( final WebContext webContext , final BaseClient client ) { var clientId = webContext . getRequestParameter ( PARAMETER_CLIENT_ID ) ; if ( StringUtils . isBlank ( clientId ) ) { if ( client instanceof SAML2Client ) { LOGGER . debug ( "Client identifier could not found as part of th... | Gets delegated client id . |
17,597 | public void setCredentials ( final UsernamePasswordCredential credential ) { val wss4jSecurityInterceptor = new Wss4jSecurityInterceptor ( ) ; wss4jSecurityInterceptor . setSecurementActions ( "Timestamp UsernameToken" ) ; wss4jSecurityInterceptor . setSecurementUsername ( credential . getUsername ( ) ) ; wss4jSecurity... | Configure credentials . |
17,598 | public Map < String , Object > handle ( ) { val model = new HashMap < String , Object > ( ) ; val diff = Duration . between ( this . upTimeStartDate , ZonedDateTime . now ( ZoneOffset . UTC ) ) ; model . put ( "upTime" , diff . getSeconds ( ) ) ; val runtime = Runtime . getRuntime ( ) ; model . put ( "totalMemory" , Fi... | Gets availability times of the server . |
17,599 | private static String [ ] toResources ( final Object [ ] args ) { val object = args [ 0 ] ; if ( object instanceof AuthenticationTransaction ) { val transaction = AuthenticationTransaction . class . cast ( object ) ; return new String [ ] { SUPPLIED_CREDENTIALS + transaction . getCredentials ( ) } ; } return new String... | Turn the arguments into a list . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.