warrant-dev / warrant

Warrant is a highly scalable, centralized authorization service based on Google Zanzibar. Use it to define, enforce, query, and audit application authorization and access control.
https://warrant.dev
Apache License 2.0
1.15k stars 43 forks source link

Correctly handle DSN config #182

Closed stanleyphu closed 1 year ago

stanleyphu commented 1 year ago

Describe your changes

This PR fixes the configuration setup to correctly handle cases when either a DSN or ReaderDSN is provided. When initializing the DB, an additional check is added to see if a DSN is provided in order to start initializing the DB connection. For initializing the reader DB, the check is also updated to see if a ReaderDSN has been provided to determine whether to connect to a reader instance.