org.apereo.cas.consent.DynamoDbConsentRepository Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cas-server-support-consent-dynamodb Show documentation
Show all versions of cas-server-support-consent-dynamodb Show documentation
cas-server-support-consent-dynamodb
package org.apereo.cas.consent;
import org.apereo.cas.authentication.Authentication;
import org.apereo.cas.authentication.principal.Service;
import org.apereo.cas.services.RegisteredService;
import lombok.RequiredArgsConstructor;
import java.io.Serial;
import java.util.Collection;
/**
* This is {@link DynamoDbConsentRepository}.
*
* @author Misagh Moayyed
* @since 6.5.0
*/
@RequiredArgsConstructor
public class DynamoDbConsentRepository implements ConsentRepository {
@Serial
private static final long serialVersionUID = 7894919721657056300L;
private final DynamoDbConsentFacilitator facilitator;
@Override
public ConsentDecision findConsentDecision(final Service service,
final RegisteredService registeredService,
final Authentication authentication) {
return facilitator.find(service, authentication.getPrincipal());
}
@Override
public Collection extends ConsentDecision> findConsentDecisions(final String principal) {
return facilitator.find(principal);
}
@Override
public Collection extends ConsentDecision> findConsentDecisions() {
return facilitator.load();
}
@Override
public ConsentDecision storeConsentDecision(final ConsentDecision decision) {
facilitator.save(decision);
return decision;
}
@Override
public boolean deleteConsentDecision(final long id, final String principal) {
return facilitator.delete(id, principal);
}
@Override
public boolean deleteConsentDecisions(final String principal) {
return facilitator.delete(principal);
}
@Override
public void deleteAll() {
facilitator.removeAll();
}
}