hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Phase out client.OutfacingID

Open grantzvolsky opened this issue 4 years ago • 0 comments

Preflight checklist

Describe your problem

Foreign keys referencing the hydra_client table currently use the OutfacingID (column name id) rather than the primary key (column name pk). The OutfacingID is deprecated (see https://github.com/ory/hydra/issues/2781) and redundant.

Describe your ideal solution

  • Deprecate client_id in the client POST endpoint. IDs are generated by Hydra without the option to be configured.
  • Use the primary key both internally and in the API.
  • ~~Allow querying with the old IDs by exposing the necessary endpoints as a v1 API.~~ [edit: the API needs to be backward compatible, so this is not an option]
  • Finally, update the FindInDb method on Flow to use Eager().Find().

~~This solution can be implemented by hashing the legacy IDs and encoding them as UUIDv4.~~

[edit]: The question of how to support the legacy identifiers remains unresolved.

Workarounds or alternatives

A slightly different approach is not to expose a v1 API, but instead to always query for either id or hash(id).

Version

v2.x

Additional Context

No response

grantzvolsky avatar Nov 05 '21 15:11 grantzvolsky