Skip to content

Conversation

@mjabascal10
Copy link
Contributor

PR: API Key Management Feature

Adds full API Key management to UTMStack, including creation, update, deletion, generation, and listing of API Keys. Users can securely generate keys (plain text returned only once) and query their usage via Elasticsearch.

Objective: Enable external applications and services to authenticate securely with UTMStack without sharing user credentials, providing controlled access, auditing, and revocation capabilities.

Endpoints are secured for users with USER authority, support pagination, and are documented with OpenAPI/Swagger annotations. Fully compatible with existing authentication and prepared for future auditing and external integrations.

AlexSanchez-bit and others added 22 commits October 16, 2025 10:56
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…or handling

Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…ser feedback

Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…n confirmation

Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…es, and expiration indicators

Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
@mjabascal10 mjabascal10 requested a review from Copilot October 28, 2025 19:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements comprehensive API Key management functionality in UTMStack, enabling external applications to authenticate securely without sharing user credentials. The implementation includes full CRUD operations for API keys, IP-based access control, expiration management, usage logging to Elasticsearch, and integration with existing authentication systems.

Key Changes:

  • Backend API endpoints for API key lifecycle management (create, update, delete, generate, list)
  • Security filter for API key authentication with IP validation and expiration checks
  • Frontend UI for managing API keys with IP/CIDR validation
  • Usage logging system storing access attempts in Elasticsearch

Reviewed Changes

Copilot reviewed 47 out of 49 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
backend/src/main/java/com/park/utmstack/web/rest/api_key/ApiKeyResource.java REST endpoints for API key CRUD operations
backend/src/main/java/com/park/utmstack/security/api_key/ApiKeyFilter.java Security filter implementing API key authentication
backend/src/main/java/com/park/utmstack/service/api_key/ApiKeyService.java Core business logic for API key management
backend/src/main/resources/config/liquibase/changelog/20251017001_create_api_keys_table.xml Database schema for API keys table
frontend/src/app/app-management/api-keys/api-keys.component.ts Main component for API key management UI
frontend/src/app/app-management/api-keys/shared/service/api-keys.service.ts Frontend service for API key HTTP operations
frontend/src/app/core/auth/account.service.ts Password encoding fix for credentials check
backend/src/main/java/com/park/utmstack/config/Constants.java New constants for API key configuration
Comments suppressed due to low confidence (1)

frontend/src/app/app-management/api-keys/shared/components/api-key-modal/api-key-modal.component.html:1

  • Corrected duplicated text 'Keep this key safeKeep this key safe' to 'Keep this key safe'
<app-utm-modal-header [name]="apiKey?.id ? 'Edit Api Key' : 'Create Api Key'"></app-utm-modal-header>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mjabascal10 and others added 30 commits October 29, 2025 11:07
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…or handling

Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…ser feedback

Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…n confirmation

Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…es, and expiration indicators

Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…-key-modal/api-key-modal.component.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…yFilter.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… and feedback

Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
…i_key

# Conflicts:
#	backend/src/main/java/com/park/utmstack/security/api_key/ApiKeyFilter.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Management — Secure Access via API Keys

3 participants