Class: PandaPal::Platform::Generic
Class Method Summary
collapse
Instance Method Summary
collapse
deserialize, from_serialized, organization_api, #public_jwks, resolve_platform, resolve_platform_class, resolve_raw_platform
Constructor Details
#initialize(options) ⇒ Generic
Returns a new instance of Generic.
108
109
110
|
# File 'app/models/panda_pal/platform.rb', line 108
def initialize(options)
@options = options
end
|
Class Method Details
.from_urls(base_url, jwks: nil, auth_redirect: nil, grant: nil) ⇒ Object
99
100
101
102
103
104
105
106
|
# File 'app/models/panda_pal/platform.rb', line 99
def self.from_urls(base_url, jwks: nil, auth_redirect: nil, grant: nil)
new({
base_url: base_url,
jwks_url: jwks,
auth_redirect_url: auth_redirect,
grant_url: grant,
})
end
|
Instance Method Details
#authentication_redirect_url ⇒ Object
120
121
122
|
# File 'app/models/panda_pal/platform.rb', line 120
def authentication_redirect_url
URI.join(options[:base_url], options[:auth_redirect_url] || "/api/lti/authorize_redirect").to_s
end
|
#grant_url ⇒ Object
124
125
126
|
# File 'app/models/panda_pal/platform.rb', line 124
def grant_url
URI.join(options[:base_url], options[:grant_url] || "/login/oauth2/token").to_s
end
|
#jwks_url ⇒ Object
116
117
118
|
# File 'app/models/panda_pal/platform.rb', line 116
def jwks_url
URI.join(options[:base_url], options[:jwks_url] || "/api/lti/security/jwks").to_s
end
|
112
113
114
|
# File 'app/models/panda_pal/platform.rb', line 112
def platform_uri
options[:issuer] || options[:base_url]
end
|
#serialize ⇒ Object
128
129
130
|
# File 'app/models/panda_pal/platform.rb', line 128
def serialize
super.merge(options)
end
|