-
Notifications
You must be signed in to change notification settings - Fork 166
Allow SPs to have multiple certs (LG-2049) #4851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
751ac71
491cd42
dd743e5
d702ba3
5b98626
7376ed1
d084f7c
ffb662f
5bfb24f
c99d472
3c5b83b
f7666c8
a708ebb
3944049
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |||||||
| require 'identity_validations' | ||||||||
|
|
||||||||
| class ServiceProvider < ApplicationRecord | ||||||||
| self.ignored_columns = %w[deal_id agency aal] | ||||||||
| self.ignored_columns = %w[deal_id agency aal fingerprint] | ||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was a very old column and adding it here makes sure we don't reference it at all
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Appears we may still be referencing it during local development
This is preventing We do want to remove that configuration value from the second file?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For posterity: #4877
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, should
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for these catches... will make a PR to remedy
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||
|
|
||||||||
| belongs_to :agency | ||||||||
|
|
||||||||
|
|
@@ -27,33 +27,20 @@ def self.from_issuer(issuer) | |||||||
| end | ||||||||
|
|
||||||||
| def metadata | ||||||||
| attributes.symbolize_keys.merge(fingerprint: fingerprint) | ||||||||
| attributes.symbolize_keys | ||||||||
| end | ||||||||
|
|
||||||||
| def ssl_cert | ||||||||
| @ssl_cert ||= begin | ||||||||
| return if cert.blank? | ||||||||
| # @return [Array<OpenSSL::X509::Certificate>] | ||||||||
| def ssl_certs | ||||||||
| @ssl_certs ||= (certs.presence || Array(cert)).map do |cert| | ||||||||
zachmargolis marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| OpenSSL::X509::Certificate.new(load_cert(cert)) | ||||||||
| end | ||||||||
| end | ||||||||
|
|
||||||||
| def fingerprint | ||||||||
| @_fingerprint ||= super || Fingerprinter.fingerprint_cert(ssl_cert) | ||||||||
| end | ||||||||
|
|
||||||||
| def encrypt_responses? | ||||||||
| block_encryption != 'none' | ||||||||
| end | ||||||||
|
|
||||||||
| def encryption_opts | ||||||||
| return nil unless encrypt_responses? | ||||||||
| { | ||||||||
| cert: ssl_cert, | ||||||||
| block_encryption: block_encryption, | ||||||||
| key_transport: 'rsa-oaep-mgf1p', | ||||||||
| } | ||||||||
| end | ||||||||
|
|
||||||||
| def skip_encryption_allowed | ||||||||
| config = AppConfig.env.skip_encryption_allowed_list | ||||||||
| return false if config.blank? | ||||||||
|
|
||||||||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
orenyk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| MIIDNjCCAh4CCQDN39Nwta1XWzANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJV | ||
| UzEdMBsGA1UECAwURGlzdHJpY3Qgb2YgQ29sdW1iaWExEzARBgNVBAcMCldhc2hp | ||
| bmd0b24xDDAKBgNVBAoMA0dTQTEMMAoGA1UECwwDVFRTMB4XDTIxMDMyOTE2Mzk1 | ||
| M1oXDTIyMDMyOTE2Mzk1M1owXTELMAkGA1UEBhMCVVMxHTAbBgNVBAgMFERpc3Ry | ||
| aWN0IG9mIENvbHVtYmlhMRMwEQYDVQQHDApXYXNoaW5ndG9uMQwwCgYDVQQKDANH | ||
| U0ExDDAKBgNVBAsMA1RUUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB | ||
| AMo28K48AyMI67bTrkXTk+THgyDLTj0aUVjmig8bTAlSZW8GLdG6I2BWlC3yCVL9 | ||
| cDx8ENWxtfG/1BQwT/+pf2f23iDzTPYR33z4Q1QZmuqZt39LGP2k3Ew0euzptQzR | ||
| anKCzNo2FbO33LnXzktlVElv8YXR0rHNsAH0+sCH/sSn/dQ8cvqyIWzKAyVeZNVX | ||
| qzyrYmLde0tiefWXrCRAZ+gbn0Vgcsd6082FaFvTRLmOWGBJaYD3SZXOSIyBgv8k | ||
| FAd6ey69M5Qg2cGiiHYF+2rxv8MP5ddA2JIyxmdxajCDJZk7zJiUUWn1Lz0ravgI | ||
| eEW1fF0w9Ss1cPvUOCCWNE8CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAw/T9Cm3n | ||
| lhuO3h8hsTJVIZqiwQw7m/wI2rY9c/on0gwnsnxsvWL3Lvl5ZyqTKqFgXWoV90ZK | ||
| PoY/Lv9c5RaPx90kV4ZwIJwzzgFVdR0gwsW6OpUXKZzt3LFNruWC+4KgmREsvRyK | ||
| 8ATfC5I5wVMxKf93YWEX3MBiHEh2VaTbn3cSukNVqUQsNAwYPrl3Fs3lXE6GbJAI | ||
| OScEZWlLdC0/uSxrDj1WA4R/8NFMWZOlG6ImlkBqGIBIyByuucXn7ZzlUp453+LP | ||
| KasY2FT+qJtytP05bULKIZHXLftV1CXktvt4dPTHvxwqDjLNiylfHFs/O76UE8ox | ||
| tz6PXT2P0wJ0Cw== | ||
| -----END CERTIFICATE----- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| class AddMultipleCertsToServiceProviders < ActiveRecord::Migration[6.1] | ||
| def change | ||
| add_column :service_providers, :certs, :string, array: true | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| -----BEGIN PRIVATE KEY----- | ||
| MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDKNvCuPAMjCOu2 | ||
| 065F05Pkx4Mgy049GlFY5ooPG0wJUmVvBi3RuiNgVpQt8glS/XA8fBDVsbXxv9QU | ||
| ME//qX9n9t4g80z2Ed98+ENUGZrqmbd/Sxj9pNxMNHrs6bUM0WpygszaNhWzt9y5 | ||
| 185LZVRJb/GF0dKxzbAB9PrAh/7Ep/3UPHL6siFsygMlXmTVV6s8q2Ji3XtLYnn1 | ||
| l6wkQGfoG59FYHLHetPNhWhb00S5jlhgSWmA90mVzkiMgYL/JBQHensuvTOUINnB | ||
| ooh2Bftq8b/DD+XXQNiSMsZncWowgyWZO8yYlFFp9S89K2r4CHhFtXxdMPUrNXD7 | ||
| 1DggljRPAgMBAAECggEAHLw77XaHt5XP8TYZgMC1NoCHiMR7RMGVp71zBvyJDJYR | ||
| 5foJztDVsB39hp3rZ0iuh1nWBpfvVAA/gfLvm1QZz8tL+4C3ggw+JwMchjnxQr8/ | ||
| TS59yaWAzK90fHAlk0G7D7S4qZWf9d791cbuANbQaHMo7ixH9Y5WIaEPdQaeVJGN | ||
| 98hDb/HnwprqUiIT6qONkECUTB5DkxfFO9YpD4GbI8lnYc7iou/T4lCCEb+OGfSt | ||
| Wqy1EDgBRZkZu122xNWRXHbjh4vtRY5DeL9kY8aNPHCqve7T/XSQT35cUScQczwX | ||
| C8Ds8qN/eXIUdoHBRlA7LHDOZOjvmRb/U6c9YUwfOQKBgQDzYN3lm/LW7p47abB7 | ||
| CUysj8+Y9QnG38BMxRkDZN/T5O1swDZbXtr9QK9gAF3ugLKae2AKL2EiZMB1scLK | ||
| M4E4XNjMJVrK4UH77Xon7Dk6r7y8N2VjhPDHjllEtYvjbopcl5JKptkFYsVO4vcA | ||
| m+OGsj2nd8QljUtwv0geD5aFLQKBgQDUs5N2IvpYI/2E6Eg7awX1eNGn7cw8gYhF | ||
| /qzCmIuUcQJnUdYMCIoZghPJ5Xz7lCBKGmcHfr+Jh1uGQkEYjNfgwEIUPLhl2qi9 | ||
| scX9/NApPhwas6xvdOfPJq/BwaMR+oAvg+c6NhxUAFPAVvSCxI8eQPnNNQzOrnkm | ||
| PDOrqHJE6wKBgHJ/b+VFqMlVGTv6TPyVM207ev8KyL63JVD4qPvfyS121fwDsY7q | ||
| 4Tuj4t3XTlmWUnA6+sPP5nK305OLPYjDElfh1ly0djJcJx7Oalm92G6znqctqJVZ | ||
| Ra2cWoLophcpOg61gC1+sTrHbOvf+zReInyL/lV7EtxXzNYOJ299BeNBAoGAOfSI | ||
| LHtRXSzJSiqEa/Q4Vm9KKQiJSr88o13GMuuftJ2qOv64ZOT6xAKGY8+s41u0BJz3 | ||
| D7rAc7e2/3kUBZ1ywOGB38O/trkCm1VSDmeRTHuI6tmkFWZ0NyRiZVfel+p6fPfi | ||
| zCCsTVMdft3yl6L5IBQyPHDFAZfWmM10gsROBmsCgYEArmE3weGh7SBveHl1nmUi | ||
| klY5edpP76N+qcRSB30ydNw2i7fHf09LzMu+/m8RmQeipaURNnF6ToE4cbQC1x/1 | ||
| sgYZNiXWR4gsdH2LjE8XWV/s9Cwf+AhFEVbvujJ9sb5xMjVol8HjV3rYog+4ID0u | ||
| gVcJW1KC4o9vRNAQPMr5kfc= | ||
| -----END PRIVATE KEY----- |
Uh oh!
There was an error while loading. Please reload this page.