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

CBG-4046 Populate test ctx to support audit checks within GetDocument calls #6976

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

torcolvin
Copy link
Collaborator

@torcolvin torcolvin commented Jul 17, 2024

GetDocument may audit information for reads.

  • change rt.GetSingleTestDatabaseCollection to return ctx.
    • One place that it was commonly used to was to construct a user. When the user construction was trivial, use rt.CreateUser, otherwise leave as is. Switch the GetUserPayload to use DataStore so it can we accessed with a single API call.
  • Switch revocationTestPassword to the default rest tester password to use CreateUser helper functions
  • switch rt.GetSingleTestDatabaseCollectionWithUser to implicitly get rt.Context() to avoid callers having to specify it.

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Integration Tests

GetDocument may audit information for reads.

- change rt.GetSingleDatabaseCollection to return user. One place that
  it was commonly used to was to construct a user. When the user
  construction was trivial, use rt.CreateUser, otherwise leave as is.
  Switch the GetUserPayload to use DataStore so it can we accessed with
  a single API call.
@adamcfraser adamcfraser changed the title CBG-4046 add ctx to GetDocument calls CBG-4046 Populate test ctx to support audit checks within GetDocument calls Jul 17, 2024
Copy link
Collaborator

@adamcfraser adamcfraser 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, modified PR title to better reflect changes

@adamcfraser adamcfraser merged commit 1ff5648 into main Jul 17, 2024
34 checks passed
@adamcfraser adamcfraser deleted the CBG-4046-ctx2 branch July 17, 2024 18:52
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.

2 participants