Skip to content

device flow cleanup#3542

Merged
ssoroka merged 8 commits intomainfrom
device-flow-cleanup
Nov 7, 2022
Merged

device flow cleanup#3542
ssoroka merged 8 commits intomainfrom
device-flow-cleanup

Conversation

@ssoroka
Copy link
Contributor

@ssoroka ssoroka commented Nov 2, 2022

Summary

  • remove expired records
  • encrypt device flow access key
  • add background jobs

Checklist

  • Wrote appropriate unit tests
  • Considered security implications of the change
  • Updated associated docs where necessary
  • Updated associated configuration where necessary
  • Change is backwards compatible if it needs to be (user can upgrade without manual steps?)
  • Nothing sensitive logged
  • Considered data migrations for smooth upgrades

@vercel vercel bot temporarily deployed to Preview November 2, 2022 20:10 Inactive
Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Looks good

@ssoroka
Copy link
Contributor Author

ssoroka commented Nov 4, 2022

@dnephin resolved your comments on the function arguments

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Nice! Looks good. A few suggestions, but nothing blocking. Would be fine as follow ups.

I still think that SetupBackgroundJobs and the jobs package create unnecessary indirection that hurts readability, but not worth blocking over it.

Comment on lines +14 to +63
prt, err := CreatePasswordResetToken(tx, &models.Identity{Model: models.Model{ID: uid.New()}}, 0)
assert.NilError(t, err)
Copy link
Contributor

@dnephin dnephin Nov 4, 2022

Choose a reason for hiding this comment

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

Not a blocker, but I've been trying to create records that won't be deleted in these tests, to show that the filter behaves properly and leaves non-expired records. I think that'd be a good improvement to this test.

IssuedFor: uid.New(),
ExpiresAt: time.Now().Add(-1),
}
_, err := CreateAccessKey(tx, ak)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here for test data

@dnephin dnephin mentioned this pull request Nov 7, 2022
- remove expired records
- encrypt device flow access key
- add background jobs
@ssoroka ssoroka force-pushed the device-flow-cleanup branch from ba9928f to b55d0ef Compare November 7, 2022 20:57
@vercel vercel bot temporarily deployed to Preview November 7, 2022 20:58 Inactive
This reverts commit b55d0ef.
@vercel vercel bot temporarily deployed to Preview November 7, 2022 21:48 Inactive
@ssoroka ssoroka merged commit ce01538 into main Nov 7, 2022
@ssoroka ssoroka deleted the device-flow-cleanup branch November 7, 2022 22:13
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.

3 participants