Class: Atlassian::JiraConnect::Jwt::Asymmetric

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
lib/atlassian/jira_connect/jwt/asymmetric.rb

Overview

Constant Summary collapse

KeyFetchError =
Class.new(StandardError)
ALGORITHM =
'RS256'
DEFAULT_PUBLIC_KEY_CDN_URL =
'https://connect-install-keys.atlassian.com'
PROXY_PUBLIC_KEY_PATH =
'/-/jira_connect/public_keys'
KEY_ID_REGEX =
%r{\A[A-Za-z0-9_\-\/]+\z}

Instance Method Summary collapse

Constructor Details

#initialize(token, verification_claims) ⇒ Asymmetric

Returns a new instance of Asymmetric.



19
20
21
22
# File 'lib/atlassian/jira_connect/jwt/asymmetric.rb', line 19

def initialize(token, verification_claims)
  @token = token
  @verification_claims = verification_claims
end

Instance Method Details

#iss_claimObject



28
29
30
31
32
# File 'lib/atlassian/jira_connect/jwt/asymmetric.rb', line 28

def iss_claim
  return unless claims

  claims['iss']
end

#valid?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/atlassian/jira_connect/jwt/asymmetric.rb', line 24

def valid?
  claims.present? && claims['qsh'] == verification_qsh
end