-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for member session authZ for RBAC (#103)
- Loading branch information
1 parent
2736209
commit 6d2bb65
Showing
2 changed files
with
34 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Stytch | ||
module MethodOptions | ||
class Authorization | ||
# A secret token for a given Stytch Session. | ||
attr_accessor :session_token | ||
# The JSON Web Token (JWT) for a given Stytch Session. | ||
attr_accessor :session_jwt | ||
|
||
def initialize(session_token: nil, session_jwt: nil) | ||
@session_token = session_token | ||
@session_jwt = session_jwt | ||
end | ||
|
||
def to_headers | ||
headers = {} | ||
headers['X-Stytch-Member-Session'] = session_token if session_token | ||
headers['X-Stytch-Member-SessionJWT'] = session_jwt if session_jwt | ||
headers | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters