Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/services/irs_attempts_api/attempt_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def to_jwe
event_data_encryption_key,
typ: 'secevent+jwe',
zip: 'DEF',
alg: 'RSA-OAEP',
enc: 'A256GCM',
)
end
Expand Down
6 changes: 6 additions & 0 deletions spec/services/irs_attempts_api/attempt_event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@
it 'returns a JWE for the event' do
jwe = subject.to_jwe

header_str, *_rest = JWE::Serialization::Compact.decode(jwe)
headers = JSON.parse(header_str)

expect(headers['alg']).to eq('RSA-OAEP')
Comment on lines +35 to +38
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test would have passed before the PR, I'm just adding it as a regression catch now


decrypted_jwe_payload = JWE.decrypt(jwe, irs_attempt_api_private_key)

token = JSON.parse(decrypted_jwe_payload)

expect(token['iss']).to eq('http://www.example.com/')
Expand Down