Class: Courier::Resources::Auth
- Inherits:
-
Object
- Object
- Courier::Resources::Auth
- Defined in:
- lib/courier/resources/auth.rb,
sig/courier/resources/auth.rbs
Overview
Issue scoped, short-lived JWTs so client-side SDKs — Inbox, Preferences, and the embedded designer — can call Courier as a single user. Server-side requests authenticate with your workspace API key instead.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Auth
constructor
private
A new instance of Auth.
-
#issue_token(expires_in:, scope:, request_options: {}) ⇒ Courier::Models::AuthIssueTokenResponse
Some parameter documentations has been truncated, see Models::AuthIssueTokenParams for more details.
Constructor Details
#initialize(client:) ⇒ Auth
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Auth.
40 41 42 |
# File 'lib/courier/resources/auth.rb', line 40 def initialize(client:) @client = client end |
Instance Method Details
#issue_token(expires_in:, scope:, request_options: {}) ⇒ Courier::Models::AuthIssueTokenResponse
Some parameter documentations has been truncated, see Models::AuthIssueTokenParams for more details.
Returns a JWT for authenticating client-side SDKs such as the Inbox. You supply the scope and an expires_in duration, both required.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/courier/resources/auth.rb', line 26 def issue_token(params) parsed, = Courier::AuthIssueTokenParams.dump_request(params) @client.request( method: :post, path: "auth/issue-token", body: parsed, model: Courier::Models::AuthIssueTokenResponse, options: ) end |