first commit

This commit is contained in:
Nilton Constantino
2026-04-22 14:55:58 +01:00
commit d48172539a
149 changed files with 4604 additions and 0 deletions
@@ -0,0 +1,2 @@
plugins { id("java-library-conventions") }
dependencies { implementation(project(":main-infrastructure")) }
@@ -0,0 +1,22 @@
package net.bquarkz.ai.gateway.authorization.contracts;
import lombok.Value;
import java.util.Set;
@Value
public class Permission {
String toolPattern;
Set<String> allowedActions;
public boolean matchesTool(String toolName) {
if (toolPattern.endsWith(".*")) {
String prefix = toolPattern.substring(0, toolPattern.length() - 2);
return toolName.startsWith(prefix + ".");
}
return toolPattern.equals(toolName) || toolPattern.equals("*");
}
public boolean allowsAction(String action) {
return allowedActions.contains("*") || allowedActions.contains(action);
}
}
@@ -0,0 +1,12 @@
package net.bquarkz.ai.gateway.authorization.contracts;
import lombok.Value;
@Value
public class Scope {
String name;
public static Scope of(String name) {
return new Scope(name);
}
}