Skip to content

Commit

Permalink
[Automated] Merged master into target k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
va-vsp-bot authored Apr 10, 2024
2 parents 65c6932 + 8b6ace6 commit 86925b9
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 52 deletions.
2 changes: 2 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ sign_in:
vaweb_client_id: vaweb
vamobile_client_id: vamobile
arp_client_id: arp
sts_client:
key_path: spec/fixtures/sign_in/sts_client.pem

terms_of_use:
current_version: v1
Expand Down
13 changes: 12 additions & 1 deletion db/seeds/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
access_token_audience: 'http://localhost:3978/api/messages',
access_token_user_attributes: ['icn'],
access_token_duration: SignIn::Constants::ServiceAccountAccessToken::VALIDITY_LENGTH_SHORT_MINUTES,
certificates: [File.read('spec/fixtures/sign_in/sample_service_account.crt')]
certificates: [File.read('spec/fixtures/sign_in/sts_client.crt')]
)

# Create config for accredited_representative_portal
Expand All @@ -124,3 +124,14 @@
access_token_attributes: %w[first_name last_name email],
refresh_token_duration: SignIn::Constants::RefreshToken::VALIDITY_LENGTH_SHORT_MINUTES,
logout_redirect_uri: 'http://localhost:3001/representatives')

# Create Service Account Config for BTSSS
btsss = SignIn::ServiceAccountConfig.find_or_initialize_by(service_account_id: 'bbb5830ecebdef04556e9c430e374972')
btsss.update!(
description: 'BTSSS',
scopes: [],
access_token_audience: 'http://localhost:3000',
access_token_user_attributes: ['icn'],
access_token_duration: SignIn::Constants::ServiceAccountAccessToken::VALIDITY_LENGTH_SHORT_MINUTES,
certificates: [File.read('spec/fixtures/sign_in/sts_client.crt')]
)
4 changes: 2 additions & 2 deletions spec/controllers/v0/sign_in_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,7 @@

context 'and assertion is a valid jwt' do
let(:private_key) { OpenSSL::PKey::RSA.new(File.read(private_key_path)) }
let(:private_key_path) { 'spec/fixtures/sign_in/sample_service_account.pem' }
let(:private_key_path) { 'spec/fixtures/sign_in/sts_client.pem' }
let(:assertion_payload) do
{
iss:,
Expand All @@ -1661,7 +1661,7 @@
let(:expiration_time) { SignIn::Constants::AccessToken::VALIDITY_LENGTH_SHORT_MINUTES.since.to_i }
let(:created_time) { Time.zone.now.to_i }
let(:uuid) { 'some-uuid' }
let(:certificate_path) { 'spec/fixtures/sign_in/sample_service_account.crt' }
let(:certificate_path) { 'spec/fixtures/sign_in/sts_client.crt' }
let(:version) { SignIn::Constants::AccessToken::CURRENT_VERSION }
let(:assertion_certificate) { File.read(certificate_path) }
let(:service_account_config) { create(:service_account_config, certificates: [assertion_certificate]) }
Expand Down
19 changes: 0 additions & 19 deletions spec/fixtures/sign_in/sample_service_account.crt

This file was deleted.

28 changes: 0 additions & 28 deletions spec/fixtures/sign_in/sample_service_account.pem

This file was deleted.

37 changes: 37 additions & 0 deletions spec/fixtures/sign_in/sts_client.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
-----BEGIN CERTIFICATE-----
MIIGZTCCBU2gAwIBAgIHPQAAAACU1zANBgkqhkiG9w0BAQsFADBIMRMwEQYKCZIm
iZPyLGQBGRYDZ292MRIwEAYKCZImiZPyLGQBGRYCdmExHTAbBgNVBAMTFFZBLUlu
dGVybmFsLVMyLUlDQTExMB4XDTI0MDQwNTE1MTkyOFoXDTI1MDQyOTE1MTkyOFow
gY8xCzAJBgNVBAYTAlVTMQ0wCwYDVQQIEwRELkMuMRMwEQYDVQQHEwpXYXNoaW5n
dG9uMSwwKgYDVQQKEyNVLlMuIERlcGFydG1lbnQgb2YgVmV0ZXJhbnMgQWZmYWly
czEuMCwGA1UEAxMlc2lnbi1pbi1zZXJ2aWNlLXN0cy12ZXRzYXBpLWxvY2FsaG9z
dDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALs8ksbzx8CkeEh9FXTW
UibrmN+Qnb/hfG3kAOvXvk1vvzzWTJ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
YWwtUzItSUNBMTEuY2VyMCIGCCsGAQUFBzABhhZodHRwOi8vb2NzcC5wa2kudmEu
Z292MAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgTwMD0GCSsGAQQBgjcVBwQwMC4G
JisGAQQBgjcVCIHIwzOB+fAGgaWfDYTggQiFwqpLBoWUjgGCoog/AgFkAgEwMB0G
A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAnBgkrBgEEAYI3FQoEGjAYMAoG
CCsGAQUFBwMBMAoGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IBAQA2NsYsrw0h
lILTMpN2K5WU5SqSsXB/zfkg9oql2Gs6zxG6lnaIiOEzTnNZo920uXdzAlBOyyfj
jEUEAzhWSUvLvNOH6lvM5PCizOyWYvDOGECwGIxIa++Nu+XR+tnakd3AZ/Y77nx8
RN/7ZcK4uSTXqHASZIERT4PlCN1MHf/7nsNQM1+WJZjKJ2wbQdxfaP8mu3PoFKq1
Cq7DIz5vdFIm5mI+pYXSZW0y4DWa5jQ5v4yaLOhwVB5K3ewIeidjyrrsCbbRNyLe
S6n2NWmidgrVLw59RO87nYqV9oHelrUyt79bjo3SrL20Mv0ePzDXjqdzi9avxkbn
zQNNc53xge5r
-----END CERTIFICATE-----
52 changes: 52 additions & 0 deletions spec/fixtures/sign_in/sts_client.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJRAIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQC7PJLG88fApHhI
fRV01lIm65jfkJ2/4Xxt5ADr175Nb7881kyRY1gc05moXZB2lTFBxLCfVD6y9Huo
98/MOK2GPuJssc1UROStamevyaH4s3Tpp60jwZC3p4LjhlgS6DWTlYF7lypwkYn/
C3sXStIuzQ4WTReojOICQ+n6rLUh630mUwLqj40F+aO0HHAISccv91FpzyZaKt+S
54S24rxiRh4kNXaqVsYh6OEfKc/U57FCW/GBAXiCI1quQiPZU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JRXtzk4uJrIm2vYqRYUG
eZeuF39PioCLV0PAJR7FS0kMg+r4/RyusRe6fr5haQKCAQA4ICsj9pLNc7py5g20
ukFf3h3zF7Gfb3bGA/Jgxsf5Is2C5NTOFMlIo5ufVjmA+OBTOcbuRQVKOWRFGW+J
KJzjwaH8m33An4rWpFVGakJjElTO+Rl2CYgvFg6VRHx/VXHnm+vpTDT3/iYhFFNF
flYXvlJbsqezS6k+7J04L+OkoS29eKdynA7d9u96L8OMXJKESSKv8SszvY8pldIm
oT282uQXzd0jvaEoG79g7Z7nDNy/j0vFQY17FGwEpGsVWrHfI6/QHBV3Qm6Oj+2u
CK6ISiLuW4V/DTs4rEilOQunbDn+JUI/Jv9URp2+vq7JCXKJqGCPClOVOE8DCQhJ
srNLAoIBAQDPF/+7PL0Br6YDjVEHQ1kWktK0GZqwP6OyFkKgeCKq6PBjv8BCtq6a
oltzMmcrZCmhpsv81szyk9R90g/N076I4RwHFpuxecikOSDHoQotqXE42rXcXk4f
3Esgi+qQI4KWbUP2ndA2y28W3wc0wbt8zCMU+/LRzs74/roPdvYC+Zl8PWkW5cbt
51bAK6VZm6QhTWGXxzWU4Uw57hsPlw/1YU8Zxvq62iyDxP8uaOqrIEjI/1W3tpZu
bJRpBxF8BkKVRc9oVhRz0TZwz/6vnyqD+W2vb40VIWESABg0yruZjlcns8v6kgy2
TIB3lEXMXkuee+jO8i+FKa6H0T8rah+w
-----END PRIVATE KEY-----
4 changes: 2 additions & 2 deletions spec/services/sign_in/assertion_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
subject { SignIn::AssertionValidator.new(assertion:).perform }

let(:private_key) { OpenSSL::PKey::RSA.new(File.read(private_key_path)) }
let(:private_key_path) { 'spec/fixtures/sign_in/sample_service_account.pem' }
let(:private_key_path) { 'spec/fixtures/sign_in/sts_client.pem' }
let(:assertion_payload) do
{
iss:,
Expand All @@ -30,7 +30,7 @@
let(:service_account_audience) { service_account_config.access_token_audience }
let(:assertion_encode_algorithm) { SignIn::Constants::Auth::ASSERTION_ENCODE_ALGORITHM }
let(:assertion) { JWT.encode(assertion_payload, private_key, assertion_encode_algorithm) }
let(:certificate_path) { 'spec/fixtures/sign_in/sample_service_account.crt' }
let(:certificate_path) { 'spec/fixtures/sign_in/sts_client.crt' }
let(:assertion_certificate) { File.read(certificate_path) }
let(:token_route) { "https://#{Settings.hostname}#{SignIn::Constants::Auth::TOKEN_ROUTE_PATH}" }

Expand Down

0 comments on commit 86925b9

Please sign in to comment.