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

83216 - Implement SignIn::Certificate model #16797

Draft
wants to merge 1 commit into
base: 83215-certs-table
Choose a base branch
from

Conversation

dickdavis
Copy link
Contributor

@dickdavis dickdavis commented May 17, 2024

Summary

  • This work is behind a feature toggle (flipper): YES/NO
  • (Summarize the changes that have been made to the platform)
  • (If bug, how to reproduce)
  • (What is the solution, why is this the solution?)
  • (Which team do you work for, does your team own the maintenance of this component?)
  • (If introducing a flipper, what is the success criteria being targeted?)

Related issue(s)

  • Link to ticket created in va.gov-team repo OR screenshot of Jira ticket if your team uses Jira
  • Link to previous change of the code/bug (if applicable)
  • Link to epic if not included in ticket

Testing done

  • New code is covered by unit tests
  • Describe what the old behavior was prior to the change
  • Describe the steps required to verify your changes are working as expected. Exclusively stating 'Specs run' is NOT acceptable as appropriate testing
  • If this work is behind a flipper:
    • Tests need to be written for both the flipper on and flipper off scenarios. Docs.
    • What is the testing plan for rolling out the feature?

Screenshots

Note: Optional

What areas of the site does it impact?

(Describe what parts of the site are impacted andifcode touched other areas)

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

@dickdavis dickdavis changed the base branch from master to 83215-certs-table May 17, 2024 21:01
Copy link

github-actions bot commented May 17, 2024

1 Error
🚫

Modified files in db/migrate or db/schema.rb changes should be the only files checked into this PR.

File Summary

DB File(s)

  • db/migrate/20240517145354_create_sign_in_certificates.rb

  • db/schema.rb

    App File(s)

    • app/models/sign_in/certificate.rb
  • spec/factories/sign_in/certificates.rb

  • spec/fixtures/sign_in/sample_configuration_certificate.crt

  • spec/fixtures/sign_in/sample_configuration_certificate.pem

  • spec/models/sign_in/certificate_spec.rb

Application code must always be backwards compatible with the DB,
both before and after migrations have been run. For more info:

1 Warning
⚠️ This PR changes 260 LoC (not counting whitespace/newlines).

In order to ensure each PR receives the proper attention it deserves, we recommend not exceeding
200. Expect some delays getting reviews.

File Summary

Files

  • app/models/sign_in/certificate.rb (+74/-0)

  • db/migrate/20240517145354_create_sign_in_certificates.rb (+16/-0)

  • db/schema.rb (+18/-1)

  • spec/factories/sign_in/certificates.rb (+27/-0)

  • spec/models/sign_in/certificate_spec.rb (+124/-0)

    Note: We exclude files matching the following when considering PR size:

    *.csv, *.json, *.tsv, *.txt, Gemfile.lock, app/swagger, modules/mobile/docs, spec/fixtures/, spec/support/vcr_cassettes/, modules/mobile/spec/support/vcr_cassettes/, db/seeds, modules/vaos/app/docs, modules/meb_api/app/docs, modules/appeals_api/app/swagger/, *.bru
    

Big PRs are difficult to review, often become stale, and cause delays.

Generated by 🚫 Danger

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file:

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) was deleted but its reference still exists in CODEOWNERS. Please update the .github/CODEOWNERS file and delete the entry for the Offending file:

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) was deleted but its reference still exists in CODEOWNERS. Please update the .github/CODEOWNERS file and delete the entry for the Offending file:

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file:

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) was deleted but its reference still exists in CODEOWNERS. Please update the .github/CODEOWNERS file and delete the entry for the Offending file:

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file:

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file:

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) was deleted but its reference still exists in CODEOWNERS. Please update the .github/CODEOWNERS file and delete the entry for the Offending file:

@va-vfs-bot va-vfs-bot temporarily deployed to 83216-cert-model/main/main May 17, 2024 22:50 Inactive
Copy link
Contributor

@rileyanderson rileyanderson left a comment

Choose a reason for hiding this comment

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

Is the initial parse and load going to be manual or should there be a callback that parses and loads before validation?

Comment on lines +36 to +54
def self.expired
where('not_after < ?', Time.zone.now)
end

def expired?
return false unless not_after

not_after < Time.zone.now
end

def self.expiring
where(not_after: Time.zone.now..60.days.from_now)
end

def self.self_signed
where('issuer = subject')
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason to not make the class methods here scopes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, these will all be scopes. I penciled them in as class methods while doing my initial draft.

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file:

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) was deleted but its reference still exists in CODEOWNERS. Please update the .github/CODEOWNERS file and delete the entry for the Offending file:

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

Successfully merging this pull request may close these issues.

None yet

4 participants