dashboard
repositories
activity
search
login
common
/
securis
summary
reflog
commits
tree
compare
forks
blame
|
history
|
raw
|
HEAD
#4410 - Comments on classes
Joaquín Reñé
2025-10-07
146a0fb8b0e90f9196e569152f649baf60d6cc8f
[common/securis.git]
/
securis
/
src
/
main
/
java
/
net
/
curisit
/
securis
/
security
/
Securable.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Copyright @ 2013 CurisTEC, S.A.S. All Rights Reserved.
*/
package net.curisit.securis.security;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import net.curisit.securis.utils.TokenHelper;
/**
* Securable
* <p>
* Method-level annotation to declare security requirements:
* - {@link #header()} name containing the auth token (defaults to {@link TokenHelper#TOKEN_HEADER_PÀRAM}).
* - {@link #roles()} required role bitmask; {@code 0} means no role restriction.
*
* Intended to be enforced by request filters/interceptors (e.g., RequestsInterceptor).
*
* @author JRA
* Last reviewed by JRA on Oct 5, 2025.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Securable {
/** Header name carrying the token to validate. */
String header() default TokenHelper.TOKEN_HEADER_PÀRAM;
/** Bitmask of required roles; set 0 for public endpoints (token still may be required). */
int roles() default 0;
}