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

getResourceInfoWithAccessDatasets fails to return ACP data #2380

Open
pduchesne opened this issue Apr 5, 2024 · 1 comment
Open

getResourceInfoWithAccessDatasets fails to return ACP data #2380

pduchesne opened this issue Apr 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@pduchesne
Copy link
Contributor

Search terms you've used

getResourceInfoWithAccessDatasets

Bug description

The getResourceInfoWithAccessDatasets method in acp.ts does not return the access datasets as expected.
More specifically, when the resource is ACP-controlled and the policy URL is set in internal_resourceInfo.aclUrl (as is the case with f.i. the Inrupt PodSpaces)
In that case, the internal_fetchAcl method internally receives a AclIsAcrError, and results in null ACLs

if (e instanceof AclIsAcrError) {
return {
resourceAcl: null,
fallbackAcl: null,

However, getResourceInfoWithAccessDatasets ignores the empty ACLs or the AclIsAcrError and returns thinking it is indeed an ACL (L206), and never reaches the fetchAcr call as it should in that case.
if (hasAccessibleAcl(resourceInfo)) {
const acl = await internal_fetchAcl(resourceInfo, options);
return internal_setAcl(resourceInfo, acl);
}
const acr = await fetchAcr(resourceInfo, options);
return { ...resourceInfo, ...acr };

Expected result

Get the ACR datasets as expected when the ACP policy URL is set in internal_resourceInfo.aclUrl

Actual result

@pduchesne pduchesne added the bug Something isn't working label Apr 5, 2024
@NSeydoux
Copy link
Contributor

NSeydoux commented Apr 9, 2024

Hi @pduchesne, thanks for reporting this, we will investigate and get back to you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants