Overview
What the admin-service does, its role in the Arya Banking platform, and the tech stack powering it.
What is the Admin Service?
The arya-banking-admin-service is the administrative backbone of the Arya Banking event-driven microservices platform. It serves a triple purpose:
- Infrastructure Administration — Manages HashiCorp Vault secrets, AppRole credentials, and HCL policies programmatically via a REST API.
- Identity Administration — Manages Keycloak realm roles and inter-service OAuth2 clients via the Keycloak Admin Client.
- Kafka Administration — Lists, creates, and describes Confluent Cloud topics via
AdminClient(KafkaAdminController,BOM 2.0.2/common-core 2.0.2).
All APIs are protected by JWT-based OAuth2 Resource Server (Keycloak-issued tokens) and role-checked at the method level via a custom RolePermissionValidator backed by the security.api-roles configuration map.
Service Coordinates
| Property | Value |
|---|---|
| Artifact | org.arya.banking:arya-banking-admin-service |
| Version | 1.0.0 |
| Java | 17 |
| Spring Boot | 3.5.4 |
| Spring Cloud | 2025.0.0 |
| Common Library | arya-banking-common:2.0.2 (core:ResponseDto, kafka module) |
| BOM | arya-banking-bom:2.0.2 |
| Server Port | 8089 |
| Base API Path | /api/admin |
| GitHub Repo | Event-Based-Banking-Application/arya-banking-admin-service |
Responsibilities
The admin-service is the only service in the platform that has elevated Vault and Keycloak privileges. Other services receive read-only access; the admin-service provisions, manages, and rotates that access.
Vault Management
- Create, read, update, and delete KV v2 secrets scoped to individual services under
secret/arya-banking/{service}/dev - Full CRUD over Vault AppRoles — including generating fresh
roleId/secretIdcredential pairs - Full CRUD over Vault ACL policies (create, read, update, delete, list) — policies stored as HCL files in classpath resources (
admin-service-policy.hcl,auth-service-policy.hcl,user-service-policy.hcl)
Keycloak Management
- Create confidential OAuth2 clients for inter-service communication (service accounts flow)
- Create, list, and query realm-level roles
- Assign the
INTERNAL_SERVICErealm role to the service account of newly-created clients
Kafka Management (kafka-ops → ROLE_ADMIN)
GET /api/admin/topics— list topics (withlistInternal,timeoutMs)POST /api/admin/topics— create topic (TopicCreationDto) →ResponseDto("200", ...)orTopicCreationException (TOPIC_CREATION_FAILED_400)GET /api/admin/topics/describe— describe topics by name
Security Enhancements
Method-Level Security (MethodSecurityConfig)
The admin-service now enables annotation-based access control via @EnableMethodSecurity(prePostEnabled = true):
@Configuration
@EnableMethodSecurity(prePostEnabled = true)
public class MethodSecurityConfig {
@Bean
static AnnotationTemplateExpressionDefaults annotationTemplateExpressionDefaults() {
return new AnnotationTemplateExpressionDefaults();
}
}
This allows using @PreAuthorize, @PostAuthorize, @Secured, and @RolesAllowed on service methods and controllers for fine-grained RBAC.
Vault Policy Service (VaultPolicyServiceImpl)
Programmatic management of Vault ACL policies:
| Method | Description |
|---|---|
getPolicies() | Lists all ACL policies in Vault (sys/policies/acl/) |
uploadPolicy(service) | Uploads HCL policy from classpath ({service}-policy.hcl) to Vault |
deletePolicy(service) | Deletes policy from Vault by service name |
Policies are version-controlled in Git and loaded via CommonUtils.loadConfig() at runtime.
Technology Stack
| Layer | Technology |
|---|---|
| Framework | Spring Boot 3.5.4 + Spring Cloud 2025.0.0 |
| REST API | Spring Web MVC |
| Security | Spring Security OAuth2 Resource Server (JWT) |
| Secrets | HashiCorp Vault (AppRole auth, KV v2) |
| Identity | Keycloak Admin Client v26.0.4 |
| Service Discovery | Netflix Eureka Client |
| Config Server | Spring Cloud Config |
| Database | MongoDB (via arya-banking-common:mongo) |
| Messaging | Confluent Cloud Kafka via arya-banking-common:kafka + kafka-clients AdminClient |
| Mapping | MapStruct 1.5.5 + local BaseMapper abstract class (TopicListingMapper, TopicDescriptionMapper) |
| API Docs | SpringDoc OpenAPI / Swagger UI |
| Build | Maven + Spring Boot Buildpacks |
| CI/CD | GitHub Actions |
Kafka AdminClient is implemented (KafkaAdminServiceImpl + AdminClientManager). Vault KV secrets now use batch VaultSecretDto(service, List<VaultSecret>) — see API Reference.