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

fix: Ensure no ACP doc check when action is node specific #3387

Conversation

fredcarle
Copy link
Collaborator

Relevant issue(s)

Resolves #3386

Description

This PR resolve the issue where re-adding docs to the p2p tropics on startup resulted in checking doc access. If we know the operation is node specific, meaning it is not to be returned to a client, then we don't need to check access through the ACP engine.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

Manual startup test.

Specify the platform(s) on which this was tested:

  • MacOS

@fredcarle fredcarle added bug Something isn't working area/acp Related to the acp (access control) system labels Jan 16, 2025
@fredcarle fredcarle added this to the DefraDB v0.16 milestone Jan 16, 2025
@fredcarle fredcarle requested a review from a team January 16, 2025 22:34
@fredcarle fredcarle self-assigned this Jan 16, 2025
Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

LGTM, good job tracking this down.

internal/db/p2p_replicator.go Outdated Show resolved Hide resolved
Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

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

LGTM

@fredcarle fredcarle force-pushed the fredcarle/fix/document-check-for-node branch from da75557 to 7bb8fe0 Compare January 17, 2025 20:35
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.40%. Comparing base (8864942) to head (7bb8fe0).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3387      +/-   ##
===========================================
+ Coverage    78.37%   78.40%   +0.03%     
===========================================
  Files          392      392              
  Lines        35707    35716       +9     
===========================================
+ Hits         27985    28002      +17     
+ Misses        6081     6077       -4     
+ Partials      1641     1637       -4     
Flag Coverage Δ
all-tests 78.40% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/db/collection_acp.go 100.00% <100.00%> (ø)
internal/db/p2p_replicator.go 61.73% <100.00%> (+0.67%) ⬆️
internal/db/p2p_schema_root.go 81.71% <100.00%> (+0.34%) ⬆️

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8864942...7bb8fe0. Read the comment docs.

@fredcarle fredcarle merged commit 442bc57 into sourcenetwork:develop Jan 17, 2025
41 of 43 checks passed
@fredcarle fredcarle deleted the fredcarle/fix/document-check-for-node branch January 17, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/acp Related to the acp (access control) system bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

checkAccessOfDocWithACP should not have to do an ACP lookup if the access is done by the node itself
3 participants