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

PropertyValue
Artifactorg.arya.banking:arya-banking-admin-service
Version1.0.0
Java17
Spring Boot3.5.4
Spring Cloud2025.0.0
Common Libraryarya-banking-common:2.0.2 (core:ResponseDto, kafka module)
BOMarya-banking-bom:2.0.2
Server Port8089
Base API Path/api/admin
GitHub RepoEvent-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 / secretId credential 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_SERVICE realm role to the service account of newly-created clients

Kafka Management (kafka-ops → ROLE_ADMIN)

  • GET /api/admin/topics — list topics (with listInternal, timeoutMs)
  • POST /api/admin/topics — create topic (TopicCreationDto) → ResponseDto("200", ...) or TopicCreationException (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):

> Java code-highlight
@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:

MethodDescription
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

LayerTechnology
FrameworkSpring Boot 3.5.4 + Spring Cloud 2025.0.0
REST APISpring Web MVC
SecuritySpring Security OAuth2 Resource Server (JWT)
SecretsHashiCorp Vault (AppRole auth, KV v2)
IdentityKeycloak Admin Client v26.0.4
Service DiscoveryNetflix Eureka Client
Config ServerSpring Cloud Config
DatabaseMongoDB (via arya-banking-common:mongo)
MessagingConfluent Cloud Kafka via arya-banking-common:kafka + kafka-clients AdminClient
MappingMapStruct 1.5.5 + local BaseMapper abstract class (TopicListingMapper, TopicDescriptionMapper)
API DocsSpringDoc OpenAPI / Swagger UI
BuildMaven + Spring Boot Buildpacks
CI/CDGitHub Actions

Kafka AdminClient is implemented (KafkaAdminServiceImpl + AdminClientManager). Vault KV secrets now use batch VaultSecretDto(service, List<VaultSecret>) — see API Reference.

admin-serviceoverviewmicroservices