Skip to content

NOSiCode-CV/igrp-platform-access-management

Repository files navigation

iGRP Access Management API

The iGRP Access Management API is a modular and extensible Identity and Access Management (IAM) solution designed for the iGRP Business Logic. It enables the management of users, roles, permissions, applications, and organizational structures, while also supporting integration with external IAM providers like Keycloak and WSO2 Identity Server, through an abstract adapter layer based on dependency injection.


🧭 Overview

This module provides identity, authentication, and authorization services to applications built within the iGRP ecosystem. It offers native capabilities as well as integration with external IAM providers. It can operate in standalone mode or delegate authentication/authorization to external systems, ensuring:

  • Interoperability with iGRP modules
  • Scalability across large infrastructures
  • Compliance with modern security standards

πŸ“š Table of Contents


✨ Features

  • Unified API for managing identity and access control
  • Plug-and-play integration with IAM providers (Keycloak, WSO2 IS)
  • Abstract adapter layer with dependency injection for extensibility
  • Fine-grained role and permission management
  • Departmental and application-level access control
  • RESTful endpoints with secure authentication

πŸ—οΈ Architecture

The system is designed around a modular architecture:

  • Core IAM Module: Provides core services for user, role, permission, and application management.
  • IAdapter Interface: Abstracts the communication with external IAM providers.
  • IAM Adapters: Implementations of IAdapter for providers like Keycloak and WSO2.
  • Dependency Injection: Ensures loose coupling between core logic and external IAM systems.
  • Spring Boot: The API is built using Spring Boot with layered service and repository components.

πŸ”Œ IAdapter

The IAdapter is an abstraction layer that defines the contract for IAM provider integrations. Each provider must implement this interface to ensure consistent behavior across the system.

TODO: Document available methods and usage patterns for the IAdapter interface.


🧩 Database Model

TODO: Add diagrams and table descriptions related to:

  • Applications
  • Departments/OrgΓ’nicas
  • Users
  • Roles
  • Permissions
  • Resources
  • Menus
  • Relations among entities (e.g., user-role, role-permission)

πŸ“‘ API Endpoints

πŸ“¦ Application Management

Endpoints

MΓ©todo Endpoint Request Response Status Code
POST /api/applications ApplicationDTO ApplicationDTO 201 Created
GET /api/applications β€” List<ApplicationDTO> 200 OK
GET /api/applications/{id} β€” ApplicationDTO 200 OK
PUT /api/applications/{id} ApplicationDTO ApplicationDTO 200 OK
DELETE /api/applications/{id} β€” β€” 204 No Content
GET /api/applications/denied-to-user/{uid} β€” List<ApplicationDTO> 200 OK
GET /api/applications/by-user/{uid} β€” List<ApplicationDTO> 200 OK
POST /api/applications/{id}/custom-fields Map<String, ?> β€” 204 No Content
POST /api/applications/{id}/custom-fields/remove List<String> β€” 204 No Content
GET /api/applications/{id}/custom-fields β€” Map<String, ?> 200 OK
GET /api/applications/by-ids List<Integer> List<ApplicationDTO> 200 OK

πŸ”Ή Create Application

  • POST /api/applications
    Creates a new application.

πŸ“₯ Request:

{
  "code": "string",
  "name": "string",
  "description": "string",
  "status": "ACTIVE",
  "type": "EXTERNAL",
  "owner": "string",
  "picture": "string",
  "url": "https://example.com/",
  "slug": "string"
}

πŸ“€ Response:

{
  "id": 1073741824,
  "code": "string",
  "name": "string",
  "description": "string",
  "status": "ACTIVE",
  "type": "EXTERNAL",
  "owner": "string",
  "picture": "string",
  "url": "https://example.com/",
  "slug": "string",
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}

πŸ”Ή List Applications

  • GET /api/applications
  • Query Params:
    • code (optional): string
    • name (optional): string

πŸ“€ Response:

[
  {
    "id": 1073741824,
    "code": "string",
    "name": "string",
    "description": "string",
    "status": "ACTIVE",
    "type": "EXTERNAL",
    "owner": "string",
    "picture": "string",
    "url": "https://example.com/",
    "slug": "string",
    "createdBy": "string",
    "createdDate": "string",
    "lastModifiedBy": "string",
    "lastModifiedDate": "string"
  }
]

πŸ”Ή Search Application by ID

  • GET /api/applications/{id}

πŸ“€ Response:

{
  "id": 1073741824,
  "code": "string",
  "name": "string",
  "description": "string",
  "status": "ACTIVE",
  "type": "EXTERNAL",
  "owner": "string",
  "picture": "string",
  "url": "https://example.com/",
  "slug": "string",
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}

πŸ”Ή Update Application

  • PUT /api/applications/{id}

πŸ“₯ Request:

{
  "code": "string",
  "name": "string",
  "description": "string",
  "status": "ACTIVE",
  "type": "EXTERNAL",
  "owner": "string",
  "picture": "string",
  "url": "https://example.com/",
  "slug": "string"
}

πŸ“€ Response: (Same format as GET by ID)

πŸ”Ή Remove Application

  • DELETE /api/applications/{id}

πŸ“€ Response: 204 No Content

πŸ”Ή Application Custom Fields

  • GET /api/applications/{id}/custom-fields

πŸ“€ Response:

{
  "field1": "value1",
  "field2": 69,
  "field3": {
    "field4": "value4"
  }
}

πŸ”Ή Application Add Custom Fields

  • POST /api/applications/{id}/custom-fields

πŸ“₯ Request:

{
  "field1": "value1",
  "field2": "value2"
}

πŸ“€ Response: 204 No Content

πŸ”Ή Application Remove Custom Fields

  • POST /api/applications/{id}/custom-fields/remove

πŸ“₯ Request:

["field1", "field2"]

πŸ“€ Response: 204 No Content

πŸ”Ή List Applications By Ids

  • POST /api/applications/by-ids

πŸ“₯ Request:

[69, 99]

πŸ“€ Response:

[
  {
    "id": 69,
    "code": "string",
    "name": "string",
    "description": "string",
    "status": "ACTIVE"
  },
  {
    "id": 99,
    "code": "string",
    "name": "string",
    "description": "string",
    "status": "ACTIVE"
  }
]

πŸ”Ή Allowed Application by UID (User Identifier)

  • GET /api/applications/by-user/{uid}

πŸ“€ Response:

[{
  "id": 1073741824,
  "code": "string",
  "name": "string",
  "description": "string",
  "status": "ACTIVE",
  "type": "EXTERNAL",
  "owner": "string",
  "picture": "string",
  "url": "https://example.com/",
  "slug": "string",
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}]

πŸ”Ή Denied Application by UID (User Identifier)

  • GET /api/applications/denied-to-user/{uid}

πŸ“€ Response:

[{
  "id": 1073741824,
  "code": "string",
  "name": "string",
  "description": "string",
  "status": "ACTIVE",
  "type": "EXTERNAL",
  "owner": "string",
  "picture": "string",
  "url": "https://example.com/",
  "slug": "string",
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}]

🏒 Department / Organization Management

Endpoints

MΓ©todo Endpoint Request Response Status Code
POST /api/departments DepartmentDTO DepartmentDTO 201 Created
GET /api/departments β€” List<DepartmentDTO> 200 OK
GET /api/departments/{id} β€” DepartmentDTO 200 OK
PUT /api/departments/{id} DepartmentDTO DepartmentDTO 200 OK
DELETE /api/departments/{id} β€” β€” 204 No Content
GET /api/departments/{id}/roles β€” List<RoleDTO> 200 OK
POST /api/departments/{id}/addRoles List<RoleDTO> List<RoleDTO> 200 OK
POST /api/departments/{id}/removeRoles List<Integer> List<RoleDTO> 200 OK
POST /api/departments/{id}/invite IGRPUserDTO β€” 200 OK

πŸ”Ή Create Departament

  • POST /api/departments
    Creates a new departament.

πŸ“₯ Request:

{
  "code": "TI",
  "name": "Tecnologias de InformaΓ§Γ£o",
  "description": "Departamento responsΓ‘vel pela infraestrutura tecnolΓ³gica",
  "status": "ACTIVE",
  "application_id": 1,
  "parent_id": null
}

πŸ“€ Response:

{
  "id": 3,
  "code": "TI",
  "name": "Tecnologias de InformaΓ§Γ£o",
  "description": "Departamento responsΓ‘vel pela infraestrutura tecnolΓ³gica",
  "status": "ACTIVE",
  "application_id": 1,
  "parent_id": null
}

πŸ”Ή List Departaments

  • GET /api/departments
    List all departaments.

πŸ“€ Response:

[
  {
    "id": 1,
    "code": "ADM",
    "name": "AdministraΓ§Γ£o",
    "description": "AdministraΓ§Γ£o Geral",
    "status": "ACTIVE",
    "application_id": 1,
    "parent_id": null
  }
]

πŸ”Ή Search Departament by ID

  • GET /api/departments/{id}
    Returns the details of a departament.

πŸ“€ Response:

{
  "id": 1,
  "code": "ADM",
  "name": "AdministraΓ§Γ£o",
  "description": "AdministraΓ§Γ£o Geral",
  "status": "ACTIVE",
  "application_id": 1,
  "parent_id": null
}

πŸ”Ή Update Departament

  • PUT /api/departments/{id}
    Updates a departament.

πŸ“₯ Request:

{
  "code": "FIN",
  "name": "Financeiro",
  "description": "GestΓ£o de recursos financeiros",
  "status": "INACTIVE",
  "application_id": 1,
  "parent_id": null
}

πŸ“€ Response: (Same format as GET by ID)

πŸ”Ή Remove Departament

  • DELETE /api/departments/{id}
    Removes a departament.

πŸ“€ Response: 204 No Content

πŸ”Έ Department Roles

πŸ”Ή List Roles
  • GET /api/departments/{id}/roles
    List all roles related to a departament.

πŸ“€ Response:

[
  {
    "id": 1,
    "name": "Admin",
    "description": "Acesso completo",
    "departmentId": 1,
    "parentId": null,
    "status": "ACTIVE"
  }
]
πŸ”Ή Add Roles
  • POST /api/departments/{id}/addRoles
    Adds a list of roles to a departament.

πŸ“₯ Request:

[
  {
    "id": 2,
    "name": "Editor",
    "description": "Permite ediΓ§Γ£o de dados",
    "departmentId": 1
  }
]

πŸ“€ Response: List of RoleDTO updated

πŸ”Ή Remove Roles
  • POST /api/departments/{id}/removeRoles
    Removes roles from departament.

πŸ“₯ Request:

[2, 3]

πŸ“€ Response: List of remaining RoleDTO

πŸ”Έ Invite User to a Departament

  • POST /api/departments/{id}/invite
    Associates a new user to the department.

πŸ“₯ Request (IGRPUserDTO):

{
  "username": "mrodrigues",
  "name": "Maria Rodrigues",
  "email": "[email protected]",
  "departmentId": 2,
  "applicationId": 1
}

πŸ“€ Response: 200 OK


πŸ” Role Management

Method Endpoint Request Response Status Code
POST /api/roles RoleDTO RoleDTO 201 Created, 404 Not Found, 400 Bad Request
GET /api/roles β€” List<RoleDTO> 200 OK
GET /api/roles/{id} β€” RoleDTO 200 OK, 404 Not Found
PUT /api/roles/{id} RoleDTO RoleDTO 200 OK, 404 Not Found
DELETE /api/roles/{id} β€” β€” 204 No Content, 404 Not Found
GET /api/roles/{id}/permissions β€” List<PermissionDTO> 200 OK, 404 Not Found
POST /api/roles/{id}/addPermissions List<Integer> List<PermissionDTO> 200 OK, 404 Not Found
POST /api/roles/{id}/removePermissions List<Integer> List<PermissionDTO> 200 OK, 404 Not Found

Rules

  • Permission name must be unique within the same Department.
  • Names are case-insensitive (e.g., role_delete_user and ROLE_DELETE_USER are considered duplicates).

Schemas

RoleDTO
{
  "id": 1073741824,
  "name": "string",
  "description": "string",
  "departmentId": 1073741824,
  "parentId": 1073741824,
  "status": "ACTIVE"
}

Create Role

  • POST /api/roles/:id
Request & Response
{
  "id": 1073741824,
  "name": "string",
  "description": "string",
  "departmentId": 1073741824,
  "parentId": 1073741824,
  "status": "ACTIVE"
}

Get Roles

Response
[
    {
        "id": 355,
        "name": "Parent",
        "description": "Create Role Create Role",
        "departmentId": 1,
        "parentId": null,
        "status": "ACTIVE"
    },
    {
        "id": 356,
        "name": "Create Child2",
        "description": "Create Role Create Role",
        "departmentId": 1,
        "parentId": 355,
        "status": "ACTIVE"
    }
]

Get Roles by ID

Request
  • GET /api/roles/:id
200 OK Response
 {
  "id": 204,
  "name": "Role1: New Name",
  "description": "Role1: New Name Description",
  "departmentId": 1,
  "parentId": null,
  "status": "ACTIVE"
}
404 Not Found Response
{
  "status": "NOT_FOUND",
  "title": "Get Role By Id",
  "details": "Role with id: 2041 not found."
}

Get Permissions By Role ID

  • POST /api/roles/:id/permissions
Response
[
  {
    "id": 4,
    "name": "Create Resource Level 3",
    "description": "Create Resource Level 3 - description",
    "status": "ACTIVE",
    "applicationId": 1
  },
  {
    "id": 1,
    "name": "Create Resource Level 1",
    "description": "Create Resource Level 1 - description",
    "status": "ACTIVE",
    "applicationId": 1
  },
  {
    "id": 2,
    "name": "Create Resource Level 2",
    "description": "Create Resource Level 2 - description",
    "status": "ACTIVE",
    "applicationId": 1
  }
]

Add Permissions

  • POST /api/roles/:id/addPermissions
Request Body
[1,2,3,4]
Response
[
    {
        "id": 2,
        "name": "Create Resource Level 2",
        "description": "Create Resource Level 2 - description",
        "status": "ACTIVE",
        "applicationId": 1
    },
    {
        "id": 1,
        "name": "Create Resource Level 1",
        "description": "Create Resource Level 1 - description",
        "status": "ACTIVE",
        "applicationId": 1
    },
    {
        "id": 4,
        "name": "Create Resource Level 3",
        "description": "Create Resource Level 3 - description",
        "status": "ACTIVE",
        "applicationId": 1
    }
]

Remove Permissions

  • POST /api/roles/:id/removePermissions
Request Body
[2, 4]
Response
[
  {
    "id": 2,
    "name": "Create Resource Level 2",
    "description": "Create Resource Level 2 - description",
    "status": "ACTIVE",
    "applicationId": 1
  },
  {
    "id": 4,
    "name": "Create Resource Level 3",
    "description": "Create Resource Level 3 - description",
    "status": "ACTIVE",
    "applicationId": 1
  }
]

πŸ›‚ Permission Management

Method Endpoint Request Response Status Code
POST /api/permissions PermissionDTO PermissionDTO 201 Created, 404 Not Found
GET /api/permissions?applicationId={id} β€” List<PermissionDTO> 200 OK
GET /api/permissions/{id} β€” PermissionDTO 200 OK, 404 Not Found
PUT /api/permissions/{id} PermissionDTO PermissionDTO 200 OK, 404 Not Found
DELETE /api/permissions/{id} β€” β€” 204 No Content, 404 Not Found
GET /api/permissions/{id}/roles β€” List<RoleDTO> 200 OK, 404 Not Found

Rules

  • Permission name must be unique within the same Application.
  • Names are case-insensitive (e.g., permission_create_user and PERMISSION_CREATE_USER are considered duplicates).

Schemas

PermissionDTO
{
  "id": 1073741824,
  "name": "string",
  "description": "string",
  "status": "ACTIVE",
  "applicationId": 1073741824
}

Create Permission

  • POST /api/permissions
Request & Response
{
  "id": null,
  "name": "string",
  "description": "string",
  "status": "ACTIVE",
  "applicationId": 5
}
404 Not Found Response
{
    "status": "NOT_FOUND",
    "title": "Create Permission",
    "details": "Application with id: 5 not found."
}

πŸ‘€ User Management

Endpoints

MΓ©todo Endpoint Request Response Status Code
POST /api/users/{id}/addRoles List<Integer> List<RoleDTO> 201 Created
POST /api/users/{id}/removeRoles List<Integer> List<RoleDTO> 200 OK
GET /api/users ?applicationId={id}&departmentId={id}&name={name}&username={username}&email={email} List<UserDTO> 200 OK
GET /api/users/{id}/roles ?applicationId={id} List<RoleDTO> 200 OK

πŸ”Ή List Users with Filters

  • GET /api/users
    Search Users applying mandatory filters.

πŸ” Required Parameters:

  • applicationId
  • departmentId
  • name
  • username
  • email

πŸ“€ Response:

[
  {
    "id": 5,
    "username": "jfernandes",
    "name": "JoΓ£o Fernandes",
    "email": "[email protected]"
  }
]

πŸ”Ή Add Roles to an User

  • POST /api/users/{id}/addRoles
    Associates new roles to a User.

πŸ“₯ Request:

[1, 3]

πŸ“€ Response:

[
  {
    "id": 1,
    "name": "Admin",
    "description": "Acesso completo",
    "departmentId": 2,
    "parentId": null,
    "status": "ACTIVE"
  }
]

πŸ”Ή Remove Roles from an User

  • POST /api/users/{id}/removeRoles
    Remove roles from User.

πŸ“₯ Request:

[3]

πŸ“€ Response: List of remaining RoleDTO

πŸ”Ή List Roles of User

  • GET /api/users/{id}/roles?applicationId={id}
    Returns the roles associated with the User in the application context.

πŸ“€ Response: (Same structure as RoleDTO)

🧭 Menu Management

Endpoints

MΓ©todo Endpoint Request Response Status Code
POST /api/menus MenuEntryDTO MenuEntryDTO 201 Created
GET /api/menus β€” List<MenuEntryDTO> 200 OK
GET /api/menus/{id} β€” MenuEntryDTO 200 OK
PUT /api/menus/{id} MenuEntryDTO MenuEntryDTO 200 OK
DELETE /api/menus/{id} β€” β€” 204 No Content

πŸ”Ή Create Menu

  • POST /api/menus

πŸ“₯ Request:

{
  "name": "string",
  "type": "MENU_PAGE",
  "position": 1073741824,
  "icon": "string",
  "status": "ACTIVE",
  "target": "string",
  "url": "string",
  "parentId": null,
  "applicationId": 1073741824,
  "resourceId": 1073741824
}

πŸ“€ Response:

{
  "id": 1073741824,
  "name": "string",
  "type": "MENU_PAGE",
  "position": 1073741824,
  "icon": "string",
  "status": "ACTIVE",
  "target": "string",
  "url": "string",
  "parentId": null,
  "applicationId": 1073741824,
  "resourceId": 1073741824,
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}

πŸ”Ή List Menus

  • GET /api/menus
  • Query Params:
    • applicationId (optional): string
    • name (optional): string
    • type (optional): string

πŸ“€ Response:

[
  {
    "id": 1073741824,
    "name": "string",
    "type": "MENU_PAGE",
    "position": 1073741824,
    "icon": "string",
    "status": "ACTIVE",
    "target": "string",
    "url": "string",
    "parentId": 1073741824,
    "applicationId": 1073741824,
    "resourceId": 1073741824,
    "createdBy": "string",
    "createdDate": "string",
    "lastModifiedBy": "string",
    "lastModifiedDate": "string"
  }
]

πŸ”Ή Search Menu by ID

  • GET /api/menus/{id}

πŸ“€ Response:

{
  "id": 1073741824,
  "name": "string",
  "type": "MENU_PAGE",
  "position": 1073741824,
  "icon": "string",
  "status": "ACTIVE",
  "target": "string",
  "url": "string",
  "parentId": 1073741824,
  "applicationId": 1073741824,
  "resourceId": 1073741824,
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}

πŸ”Ή Update Menu

  • PUT /api/menus/{id}

πŸ“₯ Request:

{
  "name": "string",
  "type": "MENU_PAGE",
  "position": 1073741824,
  "icon": "string",
  "status": "ACTIVE",
  "target": "string",
  "url": "string",
  "parentId": null
}

πŸ“€ Response: (Same format as GET by ID)

πŸ”Ή Remove Menu

  • DELETE /api/menus/{id}

πŸ“€ Response: 204 No Content

🧱 Resource Management

Endpoints

MΓ©todo Endpoint Request Response Status Code
POST /api/resources ResourceDTO ResourceDTO 201 Created
GET /api/resources β€” List<ResourceDTO> 200 OK
GET /api/resources/{id} β€” ResourceDTO 200 OK
PUT /api/resources/{id} ResourceDTO ResourceDTO 200 OK
DELETE /api/resources/{id} β€” β€” 204 No Content
POST /api/resources/{id}/custom-fields Map<String, ?> β€” 204 No Content
POST /api/resources/{id}/custom-fields/remove List<String> β€” 204 No Content
GET /api/resources/{id}/custom-fields β€” Map<String, ?> 200 OK
POST /api/resources/{id}/add-items List<ResourceItemDTO> ResourceDTO 200 OK
POST /api/resources/{id}/remove-items List<Integer> ResourceDTO 200 OK

πŸ”Ή Create Resource

  • POST /api/resources

πŸ“₯ Request:

{
  "name": "string",
  "type": "API",
  "status": "ACTIVE",
  "applicationId": 1073741824,
  "items": [
    {
      "id": 1073741824,
      "name": "string",
      "url": "string",
      "permissionId": 1073741824,
      "resourceId": 1073741824
    }
  ],
  "externalId": "string"
}

πŸ“€ Response:

{
  "id": 1073741824,
  "name": "string",
  "type": "API",
  "status": "ACTIVE",
  "applicationId": 1073741824,
  "items": [
    {
      "id": 1073741824,
      "name": "string",
      "url": "string",
      "permissionId": 1073741824,
      "resourceId": 1073741824,
      "createdBy": "string",
      "createdDate": "string",
      "lastModifiedBy": "string",
      "lastModifiedDate": "string"
    }
  ],
  "externalId": "string",
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}

πŸ”Ή List Resources

  • GET /api/resources
  • Query Params:
    • applicationId (optional): string
    • name (optional): string
    • type (optional): string
    • externalID (optional): string

πŸ“€ Response:

[
  {
    "id": 1073741824,
    "name": "string",
    "type": "API",
    "status": "ACTIVE",
    "applicationId": 1073741824,
    "items": [
      {
        "id": 1073741824,
        "name": "string",
        "url": "string",
        "permissionId": 1073741824,
        "resourceId": 1073741824,
        "createdBy": "string",
        "createdDate": "string",
        "lastModifiedBy": "string",
        "lastModifiedDate": "string"
      }
    ],
    "externalId": "string",
    "createdBy": "string",
    "createdDate": "string",
    "lastModifiedBy": "string",
    "lastModifiedDate": "string"
  }
]

πŸ”Ή Search Resource by ID

  • GET /api/resources/{id}

πŸ“€ Response:

{
  "id": 1073741824,
  "name": "string",
  "type": "API",
  "status": "ACTIVE",
  "applicationId": 1073741824,
  "items": [
    {
      "id": 1073741824,
      "name": "string",
      "url": "string",
      "permissionId": 1073741824,
      "resourceId": 1073741824,
      "createdBy": "string",
      "createdDate": "string",
      "lastModifiedBy": "string",
      "lastModifiedDate": "string"
    }
  ],
  "externalId": "string",
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}

πŸ”Ή Update Resource

  • PUT /api/resources/{id}

πŸ“₯ Request:

{
  "name": "string",
  "type": "API",
  "status": "ACTIVE",
  "applicationId": 1073741824,
  "externalId": "string"
}

πŸ“€ Response: (Same format as GET by ID)

πŸ”Ή Remove Resource

  • DELETE /api/resources/{id}

πŸ“€ Response: 204 No Content


πŸ”Ή Resource Custom Fields

  • GET /api/resources/{id}/custom-fields

πŸ“€ Response:

{
  "field1": "value1",
  "field2": 69,
  "field3": {
    "field4": "value4"
  }
}

πŸ”Ή Resource Add Custom Fields

  • POST /api/resources/{id}/custom-fields

πŸ“₯ Request:

{
  "field1": "value1",
  "field2": "value2"
}

πŸ“€ Response: 204 No Content

πŸ”Ή Resource Remove Custom Fields

  • POST /api/resources/{id}/custom-fields/remove

πŸ“₯ Request:

["field1", "field2"]

πŸ“€ Response: 204 No Content

πŸ”Ή Resource Add Items

  • POST /api/resources/{id}/add-items

πŸ“₯ Request:

[
  {
    "name": "string",
    "url": "string",
    "permissionId": 1073741824,
    "resourceId": 1073741824
  }
]

πŸ“€ Response:

{
  "id": 1073741824,
  "name": "string",
  "type": "API",
  "status": "ACTIVE",
  "applicationId": 1073741824,
  "items": [
    {
      "id": 1073741824,
      "name": "string",
      "url": "string",
      "permissionId": 1073741824,
      "resourceId": 1073741824,
      "createdBy": "string",
      "createdDate": "string",
      "lastModifiedBy": "string",
      "lastModifiedDate": "string"
    }
  ],
  "externalId": "string",
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}

πŸ”Ή Resource Remove Items

  • POST /api/resources/{id}/remove-items

πŸ“₯ Request:

[69, 99]

πŸ“€ Response:

{
  "id": 1073741824,
  "name": "string",
  "type": "API",
  "status": "ACTIVE",
  "applicationId": 1073741824,
  "items": [],
  "externalId": "string",
  "createdBy": "string",
  "createdDate": "string",
  "lastModifiedBy": "string",
  "lastModifiedDate": "string"
}

🌍 IAM Provider Integration

This project supports integration with third-party IAM systems using the IAdapter strategy:

  • KeycloakAdapter: Handles interactions with Keycloak
  • WSO2Adapter: Handles interactions with WSO2 Identity Server

To switch providers, update the application.properties file:

app.auth.provider=keycloak
# or
app.auth.provider=wso2

The appropriate adapter will be injected automatically based on this configuration.


βš™οΈ Configuration

Profile-specific configuration can be managed via:

  • application-dev.properties
  • application-prod.properties

Supports:

  • Database settings
  • IAM provider configuration
  • JWT settings
  • Mail server config (optional)

πŸš€ Running the Project

# Run the Spring Boot app
mvn spring-boot:run

πŸ“Š Code Quality & Reports

This project integrates the following tools to ensure code quality and maintainability:

βœ… Generate JaCoCo Code Coverage Report

Runs the tests and generates a coverage report:

# Run the following command
mvn clean verify

The coverage report will be available at:

target/site/jacoco/index.html

πŸ“š Generate Javadoc Documentation

Generates the Javadoc API documentation:

# Run the following command
mvn javadoc:javadoc

The documentation can be found at:

target/reports/apidocs/index.html

The maven-javadoc-plugin is configured to attach a JAR with docs, also check:

target/access-management-*-javadoc.jar

πŸ›‘ Run OWASP Dependency Check

Checks for known vulnerabilities in the dependencies:

# Using Maven verify phase
mvn verify
# Invoke directly
mvn dependency-check:check

The generated report will be available at:

target/reports/dependency-check-report.html


🀝 Contributing

Contributions are welcome! Please open issues or submit pull requests with improvements or new features.


πŸ“„ License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

About

iGRP - Spring Boot App for Access Management (v3)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •