gargle icon indicating copy to clipboard operation
gargle copied to clipboard

Add support for viewer-based credentials on Posit Connect

Open atheriel opened this issue 1 year ago • 0 comments

This commit wires up a new credential provider for Connect's viewer-based credentials feature. Most of the actual work is outsourced to a new shared package, connectcreds.

Viewer credentials are inherently tied to a given Shiny session, which is at odds with gargle's existing view that a single credential is active for a given R process -- so we need to unwind this assumption.

In order to support storing and retrieving "session" credentials from the existing AuthState object -- while preserving backward- and forward-compatibility with existing packages -- I have modified its API so that setters and getters are now aware of the existince of session credentials. (There are comprehensive unit tests that explain the details.)

Existing packages need to be updated to use this getter, if they aren't already (most are not), but in the meantime they will continue to work -- though they won't be able to use viewer-based credentials. This seems like a reasonable tradeoff, and allows us to say e.g. "upgrade bigrquery if you want to use it with Connect's viewer-based credentials".

Unit tests are included.

atheriel avatar Dec 11 '24 18:12 atheriel