All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.security.deployment.SecurityAnnotationsRegistrar Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package io.quarkus.security.deployment;

import java.util.Collections;
import java.util.List;
import java.util.Set;

import jakarta.annotation.security.DenyAll;
import jakarta.annotation.security.PermitAll;
import jakarta.annotation.security.RolesAllowed;

import io.quarkus.arc.processor.InterceptorBindingRegistrar;
import io.quarkus.security.Authenticated;
import io.quarkus.security.PermissionsAllowed;

/**
 * @author Michal Szynkiewicz, [email protected]
 */
public class SecurityAnnotationsRegistrar implements InterceptorBindingRegistrar {

    static final List SECURITY_BINDINGS = List.of(
            // keep the contents the same as in io.quarkus.resteasy.deployment.SecurityTransformerUtils
            InterceptorBinding.of(RolesAllowed.class, Collections.singleton("value")),
            InterceptorBinding.of(PermissionsAllowed.class, Set.of("value", "params", "permission", "inclusive")),
            InterceptorBinding.of(Authenticated.class),
            InterceptorBinding.of(DenyAll.class),
            InterceptorBinding.of(PermitAll.class));

    @Override
    public List getAdditionalBindings() {
        return SECURITY_BINDINGS;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy