LibHttpServer/src/dev/asdf00/lib/httpserver/annotations/HttpEndpoint.java
2023-10-01 18:01:18 +02:00

26 lines
877 B
Java

package dev.asdf00.lib.httpserver.annotations;
import dev.asdf00.lib.httpserver.Authorizer;
import dev.asdf00.lib.httpserver.internal.DefaultAuthorizer;
import dev.asdf00.lib.httpserver.utils.RequestType;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface HttpEndpoint {
RequestType type();
String location();
/**
* Minimum auth level required to access the given resource. If an auth level greater -1 is
* specified, the auth service is queried and the returned auth level is appended to the
* HttpExchange provided to this endpoint.<br/>
* default: don't care = -1
*/
Class<? extends Authorizer> auth() default DefaultAuthorizer.class;
}