Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Work on v1.5 #710

Merged
merged 4 commits into from
Jul 13, 2020
Merged

Work on v1.5 #710

merged 4 commits into from
Jul 13, 2020

Conversation

mikehelmick
Copy link
Contributor

  • Add key revision columns to exposure table
  • This includes capturing the health authority ID (if provided)
    • Keys can only be revised by the same health authority ID
  • Implement setting of Exposure fields based on the claims from the verification certificate
    • If a ReportType is present, set it in the Exposure.ReportType
    • Optionally, backfill the transmission risk, based on the report type
  • Calculate the days +/- sypmtom onset
    • the symptom onset interval can be provided in the API or from the verification certificate
  • stub out key revision
    • existing keys are read from the DB if they match the input
    • TODO: merge existing and input keys
    • TODO: implement transactional key revision
  • IterateExposures
    • add ability to select revised keys

More work on #663

* Add key revision columns to exposure table
* This includes capturing the health authority ID (if provided)
  * Keys can only be revised by the same health authority ID
* Implement setting of Exposure fields based on the claims from the verification certificate
  * If a ReportType is present, set it in the Exposure.ReportType
  * Optionally, backfill the transmission risk, based on the report type
* Calculate the days +/- sypmtom onset
  * the symptom onset interval can be provided in the API or from the verification certificate
* stub out key revision
  * existing keys are read from the DB if they match the input
  * TODO: merge existing and input keys
  * TODO: implement transactional key revision
* IterateExposures
  * add ability to select revised keys

More work on google#663
@google-oss-robot google-oss-robot added the approved Auto: added by prow when enough reviewers approve. label Jul 11, 2020
@googlebot googlebot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Jul 11, 2020
@google-oss-robot google-oss-robot added the size/XXL Auto: extra extra large number of changes. label Jul 11, 2020
internal/publish/model/exposure_model.go Outdated Show resolved Hide resolved
t.Run(tc.name, func(t *testing.T) {
got := DaysFromSymptomOnset(tc.onset, tc.check)
if tc.want != got {
t.Fatalf("wrong day instance between %v and %v, want: %v got: %v", tc.onset, tc.check, tc.want, got)
Copy link
Member

Choose a reason for hiding this comment

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

got before want

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah... fixed this, but we have this problem everywhere.

internal/publish/database/exposure.go Outdated Show resolved Hide resolved
TransmissionRisk int
AppPackageName string
Regions []string
IntervalNumber int32
Copy link
Member

Choose a reason for hiding this comment

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

Why int32? Why not uint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this has always been int32 - and aligns w/ the proto type in the export file.


// ExposureKeyBase64 returns the ExposuerKey property base64 encoded.
func (e *Exposure) ExposureKeyBase64() string {
return base64.StdEncoding.EncodeToString(e.ExposureKey)
Copy link
Member

Choose a reason for hiding this comment

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

STD or RAW? Padded or non?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exposure keys have always been StdEncoding in our use in the database.

@@ -215,7 +215,7 @@ func TestPublishWithBypass(t *testing.T) {
Error: "unable to validate diagnosis verification: token contains an invalid number of segments",
},
{
Name: "valid HA certificate",
Copy link
Member

Choose a reason for hiding this comment

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

What’s different here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

formatting / whitespace

internal/util/generate.go Outdated Show resolved Hide resolved

-- health_authority_id is nullable to preserve backwards compatibility.
ALTER TABLE exposure
ADD COLUMN health_authority_id INT REFERENCES HealthAuthority(id),
Copy link
Member

Choose a reason for hiding this comment

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

Index this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this isn't in any query at the moment.
will index later if that changes.

This will be used if a key is revised, we'll assert that it is being revised by the same health authority ID.

@sethvargo
Copy link
Member

/lgtm
/approve

@google-oss-robot google-oss-robot added the lgtm Auto: added by prown with a reviewer LGTMs label Jul 13, 2020
@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikehelmick, sethvargo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [mikehelmick,sethvargo]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit 75b4fdf into google:main Jul 13, 2020
krazykid pushed a commit to krazykid/exposure-notifications-server that referenced this pull request Jul 13, 2020
* Work on v1.5

* Add key revision columns to exposure table
* This includes capturing the health authority ID (if provided)
  * Keys can only be revised by the same health authority ID
* Implement setting of Exposure fields based on the claims from the verification certificate
  * If a ReportType is present, set it in the Exposure.ReportType
  * Optionally, backfill the transmission risk, based on the report type
* Calculate the days +/- sypmtom onset
  * the symptom onset interval can be provided in the API or from the verification certificate
* stub out key revision
  * existing keys are read from the DB if they match the input
  * TODO: merge existing and input keys
  * TODO: implement transactional key revision
* IterateExposures
  * add ability to select revised keys

More work on google#663

* review comments

* got/want fix

* tabs
@mikehelmick mikehelmick deleted the v1.5database branch July 13, 2020 18:56
krazykid pushed a commit to krazykid/exposure-notifications-server that referenced this pull request Jul 13, 2020
* Work on v1.5

* Add key revision columns to exposure table
* This includes capturing the health authority ID (if provided)
  * Keys can only be revised by the same health authority ID
* Implement setting of Exposure fields based on the claims from the verification certificate
  * If a ReportType is present, set it in the Exposure.ReportType
  * Optionally, backfill the transmission risk, based on the report type
* Calculate the days +/- sypmtom onset
  * the symptom onset interval can be provided in the API or from the verification certificate
* stub out key revision
  * existing keys are read from the DB if they match the input
  * TODO: merge existing and input keys
  * TODO: implement transactional key revision
* IterateExposures
  * add ability to select revised keys

More work on google#663

* review comments

* got/want fix

* tabs
krazykid pushed a commit to krazykid/exposure-notifications-server that referenced this pull request Jul 13, 2020
* Work on v1.5

* Add key revision columns to exposure table
* This includes capturing the health authority ID (if provided)
  * Keys can only be revised by the same health authority ID
* Implement setting of Exposure fields based on the claims from the verification certificate
  * If a ReportType is present, set it in the Exposure.ReportType
  * Optionally, backfill the transmission risk, based on the report type
* Calculate the days +/- sypmtom onset
  * the symptom onset interval can be provided in the API or from the verification certificate
* stub out key revision
  * existing keys are read from the DB if they match the input
  * TODO: merge existing and input keys
  * TODO: implement transactional key revision
* IterateExposures
  * add ability to select revised keys

More work on google#663

* review comments

* got/want fix

* tabs
@google google locked and limited conversation to collaborators Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Auto: added by prow when enough reviewers approve. cla: yes Auto: added by CLA bot when all committers have signed a CLA. lgtm Auto: added by prown with a reviewer LGTMs size/XXL Auto: extra extra large number of changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants