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

Auditability #4

Merged
merged 5 commits into from
Feb 28, 2023
Merged

Auditability #4

merged 5 commits into from
Feb 28, 2023

Conversation

dholms
Copy link
Collaborator

@dholms dholms commented Feb 23, 2023

Adds two new routes

  • /export which exports the entire PLC database as a series of jsonlines, where each line is an operation ordered by createdAt time. This is paginated with a limit of 1000 lines per req
  • /:did/auditable which gives the auditable log for a user that includes timestamps & nullified operations

@dholms dholms marked this pull request as ready for review February 27, 2023 18:28
@@ -78,6 +78,6 @@ describe('compatibility', () => {

const result = await assureValidNextOp(did, [indexedLegacy], nextOp)
expect(result.nullified.length).toBe(0)
expect(result.prev?.equals(legacyCid))
expect(result.prev?.equals(legacyCid)).toBeTruthy()
Copy link
Collaborator

Choose a reason for hiding this comment

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

👀

👍 nice catch

@@ -48,7 +53,7 @@ export const createRouter = (ctx: AppContext): express.Router => {
})

// Get data for a DID document
router.get('/data/:did', async function (req, res) {
router.get('/:did/data', async function (req, res) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 Big +1 on these changes!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yuppp

Comment on lines 79 to 80
// Get operation log for a DID
router.get('/:did/auditable', async function (req, res) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't want to overthink this name, but the fact that it's an adjective and the rest are nouns sort of piqued my attention. Only other idea I can think of is /:did/log/audit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point

honestly maybe just /:did/audit

})

// Get the most recent operation in the log for a DID
router.get('/last/:did', async function (req, res) {
router.get('/:did/last', async function (req, res) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

In a similar line of thought re: /:did/log/audit, I could also imagine calling this /:did/log/last. Really not too hung-up on it, really just one final poke to make sure we like the naming conventions here!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually you're right i'll do those 👍

Copy link
Collaborator

@devinivy devinivy left a comment

Choose a reason for hiding this comment

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

PLC just got a little comfier and cozier 👍

dholms and others added 2 commits February 28, 2023 12:33
Co-authored-by: devin ivy <devinivy@gmail.com>
Base automatically changed from db-rework to main February 28, 2023 19:26
@dholms dholms merged commit d92d3f7 into main Feb 28, 2023
@dholms dholms deleted the auditability branch February 28, 2023 19:26
@kphrx kphrx mentioned this pull request Mar 15, 2023
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