Skip to content

thorsten-l/l9g-uidgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

L9G UID Generator

Project Overview

This project is a Spring Boot application that provides a service for generating unique user IDs. It's designed to be used in a microservices architecture where a central service is needed to manage and distribute unique identifiers.

The application exposes a RESTful API for generating UIDs and is secured using Bearer Token authentication. It leverages an LDAP directory to ensure that the generated UIDs do not conflict with existing user IDs.

Key Technologies:

  • Framework: Spring Boot
  • Language: Java 21
  • Security: Spring Security with Bearer Token authentication
  • Directory Service: LDAP (via UnboundID LDAP SDK)
  • API Documentation: SpringDoc OpenAPI

Building and Running

Prerequisites

  • Java 21
  • Apache Maven

Build

To build the project, run the following command from the project root directory:

mvn clean package

This will generate a JAR file in the target directory.

Run

To run the application, use the following command:

java -jar target/l9g-uidgen.jar

The application will start on the port configured in src/main/resources/application.yaml.

Configuration

The application is configured using the config.yaml and secret.bin files. These files should be placed in the same directory as the JAR file.

config.yaml:

This file contains the main configuration for the application, including the LDAP connection details and the UID generation parameters.

secret.bin:

This file contains the encrypted secrets used by the application, such as the LDAP password and the bearer tokens.

To generate a new bearer token, you can use the -g command-line option:

java -jar target/l9g-uidgen.jar -g

To encrypt a value for use in the configuration, you can use the -e command-line option:

java -jar target/l9g-uidgen.jar -e "my-secret-value"

Development Conventions

  • Code Style: The project follows the standard Java coding conventions.
  • Dependencies: Project dependencies are managed using Maven.
  • API Documentation: The RESTful API is documented using SpringDoc OpenAPI. You can access the OpenAPI UI at /swagger-ui.html and the OpenAPI specification at /v3/api-docs.

About

Unique ID generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages