Skip to content

Commit

Permalink
Add SP DOT - FMCSA - Drug and Alcohol Clearinghouse (#3211)
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktm authored Aug 27, 2019
1 parent 96b22dd commit 7c1a223
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/assets/images/sp-logos/dot_fmcsa_clearinghouse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion app/decorators/service_provider_session_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ class ServiceProviderSessionDecorator # rubocop:disable Metrics/ClassLength

DEFAULT_LOGO = 'generic.svg'.freeze
CUSTOM_ALERT_SP_NAMES = ['CBP Trusted Traveler Programs',
'FMCSA National Registry'].freeze
'FMCSA National Registry',
'The FMCSA Drug & Alcohol Clearinghouse'].freeze
DEFAULT_ALERT_SP_NAMES = ['USAJOBS', 'SAM', 'HOMES.mil', 'HOMES.mil - test', 'Rule 19d-1'].freeze

# These are SPs that are migrating users and require special help messages
Expand All @@ -18,6 +19,10 @@ class ServiceProviderSessionDecorator # rubocop:disable Metrics/ClassLength
learn_more: 'https://login.gov/help/',
exclude_paths: ['/es', '/fr'],
},
'The FMCSA Drug & Alcohol Clearinghouse' => {
i18n_name: 'fmcsa_drug_alcohol_clearinghouse',
exclude_paths: ['/es', '/fr'],
},
}.freeze

def initialize(sp:, view_context:, sp_session:, service_provider_request:)
Expand All @@ -29,13 +34,17 @@ def initialize(sp:, view_context:, sp_session:, service_provider_request:)

delegate :redirect_uris, to: :sp, prefix: true

# :reek:DuplicateMethodCall
# rubocop:disable Style/StringLiterals, Metrics/LineLength, Rails/OutputSafety
def sp_msg(section, args = {})
args = args.merge(sp_name: sp_name)
args = args.merge(sp_create_link: sp_create_link)
return t("service_providers.#{sp_alert_name}.#{section}", args).html_safe if sp.friendly_name == "The FMCSA Drug & Alcohol Clearinghouse" && custom_alert?
return t("service_providers.#{sp_alert_name}.#{section}", args) if custom_alert?

t("service_providers.default.#{section}", args)
end
# rubocop:enable Style/StringLiterals, Metrics/LineLength, Rails/OutputSafety

def sp_logo
sp.logo || DEFAULT_LOGO
Expand Down Expand Up @@ -140,6 +149,10 @@ def mfa_expiration_interval
aal_1_expiration
end

def exclude_learn_more?
sp.friendly_name == 'The FMCSA Drug & Alcohol Clearinghouse'
end

private

attr_reader :sp, :view_context, :sp_session, :service_provider_request
Expand Down
3 changes: 2 additions & 1 deletion app/views/shared/_sp_alert.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
sign_up_email_url(request_id: params[:request_id])
= decorated_session.sp_msg('body_html', link: account_link)
p.mb0
= link_to t('service_providers.learn_more'), decorated_session.sp_alert_learn_more
- unless decorated_session.exclude_learn_more?
= link_to t('service_providers.learn_more'), decorated_session.sp_alert_learn_more
34 changes: 34 additions & 0 deletions certs/sp/dot_fmcsa_clearinghouse_prod.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-----BEGIN CERTIFICATE-----
MIIF7TCCA9WgAwIBAgIJAMbq/dgKw+xqMA0GCSqGSIb3DQEBCwUAMIGMMQswCQYD
VQQGEwJVUzELMAkGA1UECAwCTUExEjAQBgNVBAcMCUNhbWJyaWRnZTEOMAwGA1UE
CgwFRk1DU0ExDjAMBgNVBAsMBVZvbHBlMRYwFAYDVQQDDA1DbGVhcmluZ2hvdXNl
MSQwIgYJKoZIhvcNAQkBFhVjbGVhcmluZ2hvdXNlQGRvdC5nb3YwHhcNMTkwODA5
MTQwMjEzWhcNMjcwODA5MTQwMjEzWjCBjDELMAkGA1UEBhMCVVMxCzAJBgNVBAgM
Ak1BMRIwEAYDVQQHDAlDYW1icmlkZ2UxDjAMBgNVBAoMBUZNQ1NBMQ4wDAYDVQQL
DAVWb2xwZTEWMBQGA1UEAwwNQ2xlYXJpbmdob3VzZTEkMCIGCSqGSIb3DQEJARYV
Y2xlYXJpb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xDU2hxOofy6J8YW
L1Rj4QC2erVFS+KAdIUlCp9/byMFCkGPb0RDYKXIT9FGTzb/QQ1U2pNpjPCGJRtd
pAfJ4uh7TeHrRn2kOuiieNfi4G0Gc8fD2NS/7sw2wu0wkklhYj4rtXTXq+S+zNGG
Fyo3jTNcWybgDRnWgeTbMUJxXWB5ZBjdOfEGBFGICBrHYsPfXh/btBd3IsEptiLw
ta+zjnrIEh8Rv/jqK+kSJ8OjWlxBaC7nqMQoq4ywVR7vEAILHuCTgXQzvjOjSPK1
Myt4LUHQ6lml1ncGhL13gPBWRCkhgIv/W+AeDfZCfBoFzlXDXU8fIOHEvHV4Jy7t
h5OOio1hjxqTBpxkZ8jIIhhrmOcbGeRM/NdN4mBN0q1koZ8Vfwk7GDk7BAdWyKT6
GNrB19e1C3cuMeER+PvhWLJeY+br9w1dpmfGLsQW0LE9U9DgUPE6JsJyjfKHJZFO
Bo/SEkctQGIHGsy4MRXSFFiCVXVsMAhEMgXBYHM5mgtl
-----END CERTIFICATE-----
17 changes: 17 additions & 0 deletions config/locales/service_providers/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ en:
body: Please create a login.gov account using the same email address you use
for %{sp_name}
header: First time here from %{sp_name}?
fmcsa_drug_alcohol_clearinghouse:
account_page:
body: |-
FMCSA enforcement and SDLA staff do not need to create a login.gov account to
access the Clearinghouse. This includes staff from Departments of Motor Vehicles.
<p><a href="https://clearinghouse.fmcsa.dot.gov/Account/PortalLogin)">Visit the Government User login</a>
body_html: |-
FMCSA enforcement and SDLA staff do not need to create a login.gov account to
access the Clearinghouse. This includes staff from Departments of Motor Vehicles.
<p><a href="https://clearinghouse.fmcsa.dot.gov/Account/PortalLogin)">Visit the Government User login</a>
create_account_link: ''
create_account_page:
body: |-
FMCSA enforcement and SDLA staff do not need to create a login.gov account to
access the Clearinghouse. This includes staff from Departments of Motor Vehicles.
<p><a href="https://clearinghouse.fmcsa.dot.gov/Account/PortalLogin)">Visit the Government User login</a>
header: Are you FMCSA or State Driver Licensing Agency personnel?
fmcsa_natl_registry:
account_page:
body: |-
Expand Down
8 changes: 8 additions & 0 deletions config/locales/service_providers/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ es:
body: Por favor crea un login.gov cuenta usando la misma dirección de correo
electrónico que utiliza para %{sp_name}.
header: "¿Ha venido de %{sp_name}?"
fmcsa_drug_alcohol_clearinghouse:
account_page:
body: ''
body_html: ''
create_account_link: ''
create_account_page:
body: ''
header: ''
fmcsa_natl_registry:
account_page:
body: ''
Expand Down
8 changes: 8 additions & 0 deletions config/locales/service_providers/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ fr:
body: Veuillez créer un compte login.gov avec la même adresse e-mail que vous
avez utilisée pour %{sp_name}.
header: Êtes-vous venu(e) de %{sp_name}?
fmcsa_drug_alcohol_clearinghouse:
account_page:
body: ''
body_html: ''
create_account_link: ''
create_account_page:
body: ''
header: ''
fmcsa_natl_registry:
account_page:
body: ''
Expand Down
21 changes: 21 additions & 0 deletions config/service_providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1185,3 +1185,24 @@ production:
- ssn
- phone
restrict_to_deploy_env: 'prod'

# DOT - FMCSA - Drug and Alcohol Clearinghouse
'urn:gov:gsa:openidconnect.profiles:sp:sso:fmcsa:clearinghouse':
friendly_name: 'The FMCSA Drug & Alcohol Clearinghouse'
agency: 'DOT'
agency_id: 6
logo: 'dot_fmcsa_clearinghouse.svg'
cert: 'dot_fmcsa_clearinghouse_prod'
ial: 1
return_to_sp_url: 'https://clearinghouse.fmcsa.dot.gov'
redirect_uris:
- 'https://clearinghouse-beta.fmcsa.dot.gov/signin-oidc'
- 'https://clearinghouse-cie.fmcsa.dot.gov/signin-oidc'
- 'https://clearinghouse-dev.fmcsa.dot.gov/GATS/signin-oidc'
- 'https://clearinghouse-dev.fmcsa.dot.gov/Live/signin-oidc'
- 'https://clearinghouse-dev.fmcsa.dot.gov/Sprint/signin-oidc'
- 'https://clearinghouse-dev.fmcsa.dot.gov/signin-oidc'
- 'https://clearinghouse.fmcsa.dot.gov/signin-oidc'
attribute_bundle:
- 'email'
restrict_to_deploy_env: 'prod'

0 comments on commit 7c1a223

Please sign in to comment.