Skip to content
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

Rewrite config delivery, and actually request and display LOA3 data #53

Merged
merged 5 commits into from
Mar 12, 2019

Conversation

brodygov
Copy link
Contributor

@brodygov brodygov commented Mar 8, 2019

Rewrite config delivery to be more deterministic.

  • Drop the use of dotenv entirely. We were using it for private config,
    not even for secrets, so it was just creating a ton of churn without
    providing any utility.
  • Create a new config mechanism that uses LoginGov::Hostdata to provide
    all the standard defaults for Login.gov's EC2 environments. This
    should allow the sample app to work in all environments with no config
    except for the OIDC private RSA key.
  • Start moving the OIDC private key to AWS Secrets Manager. When we
    detect that the app is running in EC2, attempt to load the private key
    from AWS Secrets. If it's not found, fall back to the demo key in the
    repo only in sandbox environments. In local dev, continue using the
    demo key.
  • Drop support for HTTP basic auth, which hasn't been used since we
    migrated nonprod environments to identitysandbox.gov.
  • Allow overriding the default config values using
    config/application.yml.
  • Rewrite tests to pass with all of the above changes.

Make sample app actually do something with LOA3.

  • Fixes: Doesn't request SSN or other LOA3 fields at LOA3 #51
  • Request various available LOA3 profiles.
  • Display the SSN that we received, unredacted in local dev and redacted
    by default in all EC2 environments.
  • Display all userinfo attributes received from the SP.
  • Add test for LOA3 output and redaction.

Bundle update Gemfile.lock.

- Drop the use of dotenv entirely. We were using it for private config,
  not even for secrets, so it was just creating a ton of churn without
  providing any utility.
- Create a new config mechanism that uses LoginGov::Hostdata to provide
  all the standard defaults for Login.gov's EC2 environments. This
  should allow the sample app to work in all environments with no config
  except for the OIDC private RSA key.
- Start moving the OIDC private key to AWS Secrets Manager. When we
  detect that the app is running in EC2, attempt to load the private key
  from AWS Secrets. If it's not found, fall back to the demo key in the
  repo only in sandbox environments. In local dev, continue using the
  demo key.
- Drop support for HTTP basic auth, which hasn't been used since we
  migrated nonprod environments to identitysandbox.gov.
- Allow overriding the default config values using
  `config/application.yml`.
- Rewrite tests to pass with all of the above changes.
- Request various available LOA3 profiles.
- Display the SSN that we received, unredacted in local dev and redacted
  by default in all EC2 environments.
- Display all userinfo attributes received from the SP.
@@ -4,4 +4,4 @@
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

.env
Copy link
Member

Choose a reason for hiding this comment

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

We may wanna keep .env, just to keep it from getting accidentally checked in by anyone who's cloned this.

Copy link
Contributor

@amoose amoose left a comment

Choose a reason for hiding this comment

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

Looks great. Tested locally 👍

gem 'dotenv'
gem 'httparty'
gem 'aws-sdk-secretsmanager', '~> 1.21'
gem 'activesupport', '~> 5.2'
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: alpha sort of Gems

gem 'sinatra'
gem 'json-jwt', '~> 1.9.4'
gem 'jwt', '~> 2.1'
gem 'sinatra', '~> 2.0', '>= 2.0.2'
Copy link
Contributor

Choose a reason for hiding this comment

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

yes to pinning! 💅

@brodygov brodygov merged commit a63e41c into master Mar 12, 2019
@brodygov brodygov deleted the brody/config branch March 12, 2019 22:15
@MasterTea726
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants