Contexa AI Native Zero Trust Security Platform의 실전 예제 모음. 각 모듈은 독립적인 Spring Boot 애플리케이션으로, 가장 단순한 설정부터 고급 구성까지 단계적으로 학습할 수 있다.
| Requirement | Version |
|---|---|
| Java | 21+ |
| PostgreSQL | 15+ (pgvector extension) |
| Ollama | latest |
| Gradle | 8.x (Wrapper included) |
CREATE DATABASE contexa;
\c contexa
CREATE EXTENSION IF NOT EXISTS vector;ollama pull qwen2.5:7b
ollama pull mxbai-embed-largeAll modules depend on spring-boot-starter-contexa from Maven Local:
implementation 'ai.ctxa:spring-boot-starter-contexa:0.1.0'
| Module | Port | Description |
|---|---|---|
contexa-example-quickstart |
8081 | Minimal setup: @EnableAISecurity + YAML |
contexa-example-protectable |
8082 | @Protectable method-level AI security |
contexa-example-identity-dsl |
8083 | Identity DSL: custom auth flows |
contexa-example-shadow-enforce |
8084 | Shadow/Enforce mode transition |
| Module | Port | Description |
|---|---|---|
contexa-example-identity-rest |
8085 | REST API authentication (JSON, SPA/Mobile) |
contexa-example-identity-ott |
8086 | One-Time Token / Magic Link |
contexa-example-identity-mfa |
8087 | Advanced MFA with custom pages |
contexa-example-identity-asep |
8088 | ASEP security exception annotations |
contexa-example-identity-oauth2 |
8089 | OAuth2 JWT stateless authentication |
| Module | Port | Description |
|---|---|---|
contexa-example-iam-dynamic-auth |
8090 | URL dynamic authorization with AI security expressions (#trust, #ai) |
contexa-example-iam-protectable-analysis |
8091 | @Protectable + 5 AnalysisRequirement levels + SSE real-time LLM analysis |
contexa-example-iam-permission |
8092 | hasPermission() with custom DomainPermissionEvaluator |
| Module | Port | Description |
|---|---|---|
contexa-example-ai-lab |
8093 | Custom AILab + AIStrategy + PromptTemplate (sentiment analysis) |
contexa-example-ai-pipeline |
8094 | PipelineOrchestrator + Custom PipelineStep + DomainResponseProcessor + SSE streaming |
contexa-example-ai-llm |
8095 | UnifiedLLMOrchestrator + Custom BaseAdvisor + ExecutionContext + Chat UI |
Each module runs independently:
# Quickstart (port 8081)
./gradlew :contexa-example-quickstart:bootRun
# Protectable (port 8082)
./gradlew :contexa-example-protectable:bootRun
# Identity DSL (port 8083)
./gradlew :contexa-example-identity-dsl:bootRun
# Shadow Mode (port 8084)
./gradlew :contexa-example-shadow-enforce:bootRun --args='--spring.profiles.active=shadow'
# Enforce Mode (port 8084)
./gradlew :contexa-example-shadow-enforce:bootRun --args='--spring.profiles.active=enforce'
# Identity REST (port 8085)
./gradlew :contexa-example-identity-rest:bootRun
# Identity OTT (port 8086)
./gradlew :contexa-example-identity-ott:bootRun
# Identity MFA (port 8087)
./gradlew :contexa-example-identity-mfa:bootRun
# Identity ASEP (port 8088)
./gradlew :contexa-example-identity-asep:bootRun
# Identity OAuth2 (port 8089)
./gradlew :contexa-example-identity-oauth2:bootRun
# IAM Dynamic Auth (port 8090)
./gradlew :contexa-example-iam-dynamic-auth:bootRun
# IAM Protectable Analysis (port 8091)
./gradlew :contexa-example-iam-protectable-analysis:bootRun
# IAM Permission (port 8092)
./gradlew :contexa-example-iam-permission:bootRun
# AI Lab (port 8093) — http://localhost:8093/lab/test
./gradlew :contexa-example-ai-lab:bootRun
# AI Pipeline (port 8094) — http://localhost:8094/pipeline/test
./gradlew :contexa-example-ai-pipeline:bootRun
# AI LLM (port 8095) — http://localhost:8095/llm/test
./gradlew :contexa-example-ai-llm:bootRunAll modules share the following base configuration:
contexa:
infrastructure:
mode: standalone
spring:
datasource:
url: jdbc:postgresql://localhost:5432/contexa
username: ${DB_USERNAME:admin}
password: ${DB_PASSWORD:1111}
driver-class-name: org.postgresql.Driver
jpa:
database: POSTGRESQL
hibernate:
ddl-auto: update
ai:
chat:
model:
priority: ollama
ollama:
base-url: http://127.0.0.1:11434
chat:
options:
model: qwen2.5:7b
keep-alive: "24h"
embedding:
enabled: true
model: mxbai-embed-large
vectorstore:
pgvector:
table-name: vector_store
index-type: HNSW
distance-type: COSINE_DISTANCE
dimensions: 1024
initialize-schema: trueEnvironment variables DB_USERNAME and DB_PASSWORD can override database credentials.
# Compile all modules
./gradlew compileJava
# Build all modules
./gradlew build