add variable expansion for getting uuid on root accounts
test plan - add a custom variable expansion for $vnd.Canvas.root_account.global_id * it should be substituted for root_account.uuid in any LTI launch - the capability vnd.Canvas.root_account.global_id should appear in the tool consumer profile - install an LTI 2 tool that requests the capability vnd.Canvas.root_account.global_id * launches should come with vnd_canvas_root_account_id=<root_account.uuid> fixes PLAT-2267 Change-Id: I23be140c22c0edd8e20460f648c51cc570a45e80 Reviewed-on: https://gerrit.instructure.com/102077 Tested-by: Jenkins Reviewed-by: Nathan Mills <nathanm@instructure.com> QA-Review: August Thornton <august@instructure.com> Product-Review: Brad Humphrey <brad@instructure.com>
This commit is contained in:
parent
e3fd90747d
commit
9fad40e8de
|
@ -12,7 +12,8 @@ module Lti
|
|||
User.image
|
||||
Message.documentTarget
|
||||
Message.locale
|
||||
Context.id).freeze
|
||||
Context.id
|
||||
vnd.Canvas.root_account.uuid).freeze
|
||||
|
||||
def self.supported_capabilities
|
||||
SUPPORTED_CAPABILITIES
|
||||
|
|
|
@ -263,6 +263,15 @@ module Lti
|
|||
register_expansion 'Canvas.root_account.id', [],
|
||||
-> { @root_account.id }
|
||||
|
||||
# returns the account uuid for the current context.
|
||||
# @example
|
||||
# ```
|
||||
# Ioe3sJPt0KZp9Pw6xAvcHuLCl0z4TvPKP0iIOLbo
|
||||
# ```
|
||||
register_expansion 'vnd.Canvas.root_account.uuid', [],
|
||||
-> { @root_account.uuid },
|
||||
default_name: 'vnd_canvas_root_account_uuid'
|
||||
|
||||
# returns the root account sis source id for the current context.
|
||||
# @deprecated
|
||||
# @example
|
||||
|
|
|
@ -68,7 +68,8 @@ module Lti
|
|||
User.image
|
||||
Message.documentTarget
|
||||
Message.locale
|
||||
Context.id)
|
||||
Context.id
|
||||
vnd.Canvas.root_account.uuid)
|
||||
}
|
||||
describe '#supported_capabilities' do
|
||||
it 'returns all supported capabilities asociated with launch params' do
|
||||
|
|
|
@ -334,6 +334,13 @@ module Lti
|
|||
expect(exp_hash[:test]).to eq 54321
|
||||
end
|
||||
|
||||
it 'has substitution for $Canvas.account.name' do
|
||||
allow(root_account).to receive(:uuid).and_return('123-123-123-123')
|
||||
exp_hash = {test: '$vnd.Canvas.root_account.uuid'}
|
||||
subject.expand_variables!(exp_hash)
|
||||
expect(exp_hash[:test]).to eq '123-123-123-123'
|
||||
end
|
||||
|
||||
it 'has substitution for $Canvas.root_account.sisSourceId' do
|
||||
root_account.sis_source_id = 'cd45'
|
||||
exp_hash = {test: '$Canvas.root_account.sisSourceId'}
|
||||
|
|
Loading…
Reference in New Issue