We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
anubis/anubis-management-api/anubis/wac.py
Line 28 in 10a293c
acl = Namespace("http://www.w3.org/ns/auth/acl#") oc_acl = Namespace("http://voc.orchestracities.io/oc-acl#") def parse_rdf_graph(data): g = Graph() g.bind("acl", acl) g.bind("oc_acl", oc_acl) g.parse(data=data) nm = NamespaceManager(g) policies = {} for subj, pred, obj in g: policy = str(subj).split("/")[-1] if not policies.get(policy): policies[policy] = {} if pred == acl.agentClass: policies[policy]["agentClass"] = redux(str(nm.normalizeUri(obj))) if pred == acl.mode: policies[policy]["mode"] = redux(str(nm.normalizeUri(obj))) # TODO deal with this better. if pred == acl.accessTo: policies[policy]["accessTo"] = str(obj).split("/")[-1] if pred == acl.default: policies[policy]["accessTo"] = "default" if pred == acl.accessToClass: policies[policy]["accessToClass"] = str( nm.normalizeUri(obj)).split(":")[-1] return policies def redux(uri: str): if "http://www.w3.org/ns/auth/acl#" in uri: return "acl:" + uri[len("http://www.w3.org/ns/auth/acl#") + 1:-1] if "http://voc.orchestracities.io/oc-acl#" in uri: return "oc-acl:" + \ uri[len("http://voc.orchestracities.io/oc-acl#") + 1:-1] if "http://xmlns.com/foaf/0.1/" in uri: return "foaf:" + uri[len("http://xmlns.com/foaf/0.1/") + 1:-1] if "<" in uri[0] and ">" in uri[-1]: return uri[1:-1] return uri def serialize( db: Session, fiware_service: [str],
The text was updated successfully, but these errors were encountered:
No branches or pull requests
anubis/anubis-management-api/anubis/wac.py
Line 28 in 10a293c
The text was updated successfully, but these errors were encountered: