Andreas Svanberg bc4dbaf5f7
All checks were successful
/ build (push) Successful in 1m13s
Database index for looking up authorizations by any attribute
Instead of being forced to use a table scan it now uses the available indexes for direct access to the correct rows.

Fixes #15

Old `ANALYZE` output
```
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: v2_oauth2_authorization
         type: ALL
possible_keys: I_authorization_code_token,I_authorization_access_token
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 7473
       r_rows: 11669.00
     filtered: 100.00
   r_filtered: 0.00
        Extra: Using where
```
and after indexes were added
```
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: v2_oauth2_authorization
         type: index_merge
possible_keys: I_authorization_code_token,I_authorization_access_token,I_authorization_device_code_token,I_authorization_state,I_authorization_user_code_token,I_authorization_refresh_token,I_authorization_id_token
          key: I_authorization_state,I_authorization_code_token,I_authorization_device_code_token,I_authorization_user_code_token,I_authorization_access_token,I_authorization_refresh_token,I_authorization_id_token
      key_len: 3075,3075,3075,3075,3075,3075,3075
          ref: NULL
         rows: 7
       r_rows: 0.00
     filtered: 100.00
   r_filtered: 100.00
        Extra: Using sort_union(I_authorization_state,I_authorization_code_token,I_authorization_device_code_token,I_authorization_user_code_token,I_authorization_access_token,I_authorization_refresh_token,I_authorization_id_token); Using where
```
2026-02-23 14:04:41 +01:00
2025-03-21 15:14:33 +01:00
2025-03-21 15:14:43 +01:00
2025-03-25 12:44:32 +01:00
2025-03-21 15:14:33 +01:00
2026-02-20 09:39:20 +01:00

Using as an embedded Docker Compose service

services:
  oauth2:
    image: gitea.dsv.su.se/dmc/oauth2:latest
    ports:
      - "<host_port>:8080"
    environment:
      CLIENT_ID=awesome-app
      CLIENT_SECRET=p4ssw0rd
      CLIENT_REDIRECT_URI=http://localhost/oauth2/callback

Development

Prerequisites

  • JDK 17 (or later)
  • Docker
  • Docker compose 2.24.0 (or later)

Run mvnw spring-boot:run to start the application.

If running via IntelliJ or some other means make sure the "dev" Spring profile is activated. You may have to run mvnw compile to generate any necessary files.

The application will be available at http://localhost:8080

Description
No description provided
Readme 645 KiB
Languages
Java 99%
Dockerfile 0.9%
CSS 0.1%