Named graph security: 'Invalid resource name'

Using version 5.3.4 in production.

I've enabled security.named.graphs=true for a database ng-test, and am trying to assign some user permissions, but when the named graph IRI has a hash symbol in it I get the following:

stardog-admin --server https://myHost user grant -u stardog-admin -a read -o named-graph:ng-test\\http://purl.org/net/grafli#tbox -- grafli-r-conradL

Invalid resource name

The command works fine when the graph IRI does not contain a hash.

I'm pretty sure this used to work in version 4.x

You should escape it or add quotes so the shell doesn't interpret it as a comment.

Jess

nope; neither escaping, nor single nor double quotes work. I would expect the shell would only interpret a space followed by hash as a comment anyhow.

I've tried using the HTTP API directly, same result:

curl \
    -H "Content-Type: application/json" \
    -X "PUT" \
    --user stardog-admin:**** \
    --data '{"action":"READ","resource_type":"named-graph","resource":["grafli-gqa-test\\http://purl.org/net/grafli#tbox"]}' \ 
    https://myHost:5820/admin/permissions/role/grafliGqaTestWriter

{ "message" : "invalid resource: 'grafli-gqa-test\http://purl.org/net/grafli#tbox'."}

And also using the Java API, same result:

import com.typesafe.config.ConfigFactory
import com.typesafe.config.ConfigValueFactory
  
import com.complexible.common.rdf.model.Values
import com.complexible.stardog.security.NamedGraphPermissions
  
import au.edu.qimr.stardog.ConnectionFactory

val adminConfig = ConfigFactory
    .load(getClass.getClassLoader)
    .getConfig("stardog.adminConnection")
    .withValue("hostname", ConfigValueFactory.fromAnyRef("****"))
    .withValue("username", ConfigValueFactory.fromAnyRef("stardog-admin"))
val conn = ConnectionFactory.getAdminConnection(adminConfig)
val perms = NamedGraphPermissions
    .on(conn.get.getPermissionManager, "grafli-gqa-test")
    .read(Values.iri("http://purl.org/net/grafli#tbox"))
    .grantRole("grafliGqaTestWriter")

run it:

com.complexible.stardog.protocols.http.client.BaseHttpClient$HttpClientException: invalid resource: 'http://purl.org/net/grafli#tbox'.
	at com.complexible.stardog.protocols.http.client.BaseHttpClient.checkResponseCode(BaseHttpClient.java:537)
	at com.complexible.stardog.protocols.http.client.BaseHttpClient.execute(BaseHttpClient.java:363)
	at com.complexible.stardog.protocols.http.client.BaseHttpClient.executeHttpPut(BaseHttpClient.java:635)
	at com.complexible.stardog.protocols.http.client.HttpAdminClientImpl.addRolePerm(HttpAdminClientImpl.java:160)
	at com.complexible.stardog.security.NamedGraphPermissions.modifyPermissions(NamedGraphPermissions.java:125)
	at com.complexible.stardog.security.NamedGraphPermissions.grantRole(NamedGraphPermissions.java:83)
	at Main$$anon$1.<init>(setNgPerms.scala:18)
	at Main$.main(setNgPerms.scala:1)
	at Main.main(setNgPerms.scala)

reading the stack trace, this is in the response from the client after it's executed the command, so it's server-side issue.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.