Search in sources :

Example 31 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project cas by apereo.

the class OAuth20AccessTokenExpirationPolicy method isAccessTokenExpired.

/**
 * Is access token expired ?
 *
 * @param ticketState the ticket state
 * @return true/false
 */
@JsonIgnore
protected boolean isAccessTokenExpired(final Ticket ticketState) {
    val currentSystemTime = ZonedDateTime.now(ZoneOffset.UTC);
    val creationTime = ticketState.getCreationTime();
    var expirationTime = creationTime.plus(this.maxTimeToLiveInSeconds, ChronoUnit.SECONDS);
    if (currentSystemTime.isAfter(expirationTime)) {
        LOGGER.debug("Access token is expired because the current time [{}] is after [{}]", currentSystemTime, expirationTime);
        return true;
    }
    val expirationTimeToKill = ticketState.getLastTimeUsed().plus(this.timeToKillInSeconds, ChronoUnit.SECONDS);
    if (currentSystemTime.isAfter(expirationTimeToKill)) {
        LOGGER.debug("Access token is expired because the current time [{}] is after [{}]", currentSystemTime, expirationTimeToKill);
        return true;
    }
    return false;
}
Also used : lombok.val(lombok.val) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 32 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project cas by apereo.

the class BaseSamlRegisteredServiceAttributeReleasePolicy method determineServiceProviderMetadataFacade.

/**
 * Determine service provider metadata facade.
 *
 * @param registeredService the registered service
 * @param entityId          the entity id
 * @return the optional
 */
@JsonIgnore
protected static Optional<SamlRegisteredServiceServiceProviderMetadataFacade> determineServiceProviderMetadataFacade(final SamlRegisteredService registeredService, final String entityId) {
    val applicationContext = ApplicationContextProvider.getApplicationContext();
    val resolver = applicationContext.getBean(SamlRegisteredServiceCachingMetadataResolver.DEFAULT_BEAN_NAME, SamlRegisteredServiceCachingMetadataResolver.class);
    return SamlRegisteredServiceServiceProviderMetadataFacade.get(resolver, registeredService, entityId);
}
Also used : lombok.val(lombok.val) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 33 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project cas by apereo.

the class DefaultAttributeDefinition method getScriptedAttributeValue.

@JsonIgnore
private List<Object> getScriptedAttributeValue(final String attributeKey, final List<Object> currentValues, final RegisteredService registeredService, final Map<String, List<Object>> attributes) {
    LOGGER.trace("Locating attribute value via script for definition [{}]", this);
    val matcherInline = ScriptingUtils.getMatcherForInlineGroovyScript(getScript());
    if (matcherInline.find()) {
        return fetchAttributeValueAsInlineGroovyScript(attributeKey, currentValues, matcherInline.group(1), registeredService, attributes);
    }
    val matcherFile = ScriptingUtils.getMatcherForExternalGroovyScript(getScript());
    if (matcherFile.find()) {
        return fetchAttributeValueFromExternalGroovyScript(attributeKey, currentValues, matcherFile.group(), registeredService, attributes);
    }
    return new ArrayList<>(0);
}
Also used : lombok.val(lombok.val) ArrayList(java.util.ArrayList) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 34 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project cas by apereo.

the class TicketGrantingTicketImpl method getChainedAuthentications.

@JsonIgnore
@Override
public List<Authentication> getChainedAuthentications() {
    val list = new ArrayList<Authentication>(2);
    list.add(getAuthentication());
    if (this.getTicketGrantingTicket() == null) {
        return list;
    }
    list.addAll(this.getTicketGrantingTicket().getChainedAuthentications());
    return list;
}
Also used : lombok.val(lombok.val) ArrayList(java.util.ArrayList) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 35 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project Gaffer by gchq.

the class AddNamedOperation method setOperationChain.

@JsonIgnore
public void setOperationChain(final OperationChain operationChain) {
    try {
        if (operationChain instanceof OperationChainDAO) {
            this.operations = new String(JSONSerialiser.serialise(operationChain), Charset.forName(CHARSET_NAME));
        } else {
            final OperationChainDAO dao = new OperationChainDAO(operationChain.getOperations());
            this.operations = new String(JSONSerialiser.serialise(dao), Charset.forName(CHARSET_NAME));
        }
    } catch (final SerialisationException se) {
        throw new IllegalArgumentException(se.getMessage());
    }
}
Also used : OperationChainDAO(uk.gov.gchq.gaffer.operation.OperationChainDAO) SerialisationException(uk.gov.gchq.gaffer.exception.SerialisationException) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)111 lombok.val (lombok.val)14 ArrayList (java.util.ArrayList)11 HashMap (java.util.HashMap)8 Map (java.util.Map)8 HashSet (java.util.HashSet)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 Date (java.util.Date)5 Field (com.hortonworks.registries.common.Schema.Field)4 Set (java.util.Set)4 Schema (com.hortonworks.registries.common.Schema)3 PrimaryKey (com.hortonworks.registries.storage.PrimaryKey)3 EntitlementException (com.sun.identity.entitlement.EntitlementException)3 PolicyException (com.sun.identity.policy.PolicyException)3 JsonArray (io.vertx.core.json.JsonArray)3 List (java.util.List)3 SequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile)2 TrustAndKeyProvider (com.codingchili.core.security.TrustAndKeyProvider)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)2