Class: SemgrepWebApp::SemgrepAdminJwt
- Inherits:
-
CoreLibrary::HeaderAuth
- Object
- CoreLibrary::HeaderAuth
- SemgrepWebApp::SemgrepAdminJwt
- Includes:
- CoreLibrary
- Defined in:
- lib/semgrep_web_app/http/auth/semgrep_admin_jwt.rb
Overview
Utility class for OAuth 2 authorization and token management.
Instance Method Summary collapse
-
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
-
#initialize(semgrep_admin_jwt_credentials) ⇒ SemgrepAdminJwt
constructor
Initialization constructor.
Constructor Details
#initialize(semgrep_admin_jwt_credentials) ⇒ SemgrepAdminJwt
Initialization constructor.
17 18 19 20 21 22 23 24 |
# File 'lib/semgrep_web_app/http/auth/semgrep_admin_jwt.rb', line 17 def initialize(semgrep_admin_jwt_credentials) auth_params = {} @_access_token = semgrep_admin_jwt_credentials.access_token unless semgrep_admin_jwt_credentials.nil? || semgrep_admin_jwt_credentials.access_token.nil? auth_params[:Authorization] = "Bearer #{@_access_token}" unless @_access_token.nil? super auth_params end |
Instance Method Details
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
12 13 14 |
# File 'lib/semgrep_web_app/http/auth/semgrep_admin_jwt.rb', line 12 def 'SemgrepAdminJwt: access_token is undefined.' end |