Skip to content

[BUG] AppAuth lifecycle reservation SQL has no PostgreSQL or Oracle dialect implementation #8133

Closed

Description

@Aias00

Environment

Master aab453f06dbd135da9b329ee153758ceac0e1834 (2.7.3-SNAPSHOT), Admin AppAuth lifecycle API with a PostgreSQL or Oracle database.

Problem

apply and revoke both begin by calling AppAuthRequestMapper.reserveIfAbsent, whose only SQL implementation uses MySQL-specific syntax:

INSERT INTO app_auth_request
    (id, caller_key, namespace_id, request_id, request_hash, auth_id, state)
VALUES (...)
ON DUPLICATE KEY UPDATE id = app_auth_request.id

There is no databaseId-specific PostgreSQL/Oracle implementation or supported alternative. The lifecycle endpoints therefore reach unsupported reservation SQL on those backends.

Code evidence

  • Reservation mapper: unconditional ON DUPLICATE KEY UPDATE.
  • Apply reservation and revoke in the same transaction service both use this mapper operation.
  • Database ID provider already distinguishes PostgreSQL, Oracle, MySQL and other backends.
  • AppAuth request tables and lifecycle permissions were added to the PostgreSQL/Oracle schema and upgrade scripts as well, so this is not confined to a MySQL-only schema installation.

Reproduction / validation

On a properly migrated PostgreSQL/Oracle Admin deployment, configure an authorized service account and invoke lifecycle apply or revoke; inspect the first reservation statement.

Local parser checks using the reservation statement and an isolated H2 table produced:

H2 MODE=MySQL: accepted
H2 MODE=PostgreSQL: rejected, SQLState=42001
H2 MODE=Oracle: rejected, SQLState=42000

These checks exercise H2 compatibility modes, not real PostgreSQL or Oracle servers. The unsupported-dialect finding is based on the actual mapper SQL and its absence of dialect variants; real-database integration and concurrency validation remain required.

Expected behavior / acceptance

  • Implement reservation SQL with the appropriate database dialects, retaining the unique caller/namespace/request key and the following locking semantics.
  • Preserve same-request replay, different-payload conflict detection, revoked tombstones and transaction rollback behavior.
  • Run lifecycle apply/revoke/replay and concurrent reservation tests on real PostgreSQL and Oracle, alongside the existing MySQL coverage.
  • Explicitly define support for H2, OceanBase and OpenGauss according to the supported Admin database matrix.

Activity

  1. added
    type: bug
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions