-
Notifications
You must be signed in to change notification settings - Fork 33
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
Policies not found #24
Comments
Hello @xxabdelxx, did you installed opentwins following the helm tutorial? |
I have the same problem with Grafana (ver. 9.5.2) and policies. Although I am logged in as admin in Grafana, I am not able to manually add the policy, nor can I see any policy in the OpenTwins App. On the other side, I can see connections and everything else. I have installed everything through Helm. |
Hi @gogardas, as I commented in this issue #6 (comment), in the actual version of OpenTwins you can not create a policy through Grafana. Policies are an Eclipse Ditto component to give different users access to certain features. Currently, OpenTwins does not have user control far from admin and viewer so having different policies does not help. The way of creating a new policy is through Eclipse Ditto Nginx (e.g. CURL, Postman, etc) to your Eclipse Ditto Nginx (PUT http://yourDittoNginxurl/api/2/policies/{policyId}). Our basic policy is: {
"policyId": "default:basic_policy",
"imports": {},
"entries": {
"DEFAULT": {
"subjects": {
"pre-authenticated:kafkaml-connection": {
"type": "Connection to KafkaML"
},
"pre-authenticated:hono-connection": {
"type": "Connection to Eclipse Hono"
},
"nginx:ditto": {
"type": "Ditto user authenticated via nginx"
}
},
"resources": {
"policy:/": {
"grant": [
"READ",
"WRITE"
],
"revoke": []
},
"thing:/": {
"grant": [
"READ",
"WRITE"
],
"revoke": []
},
"message:/": {
"grant": [
"READ",
"WRITE"
],
"revoke": []
}
},
"importable": "implicit"
}
}
} The other problem is that you can not see the basic policy. Maybe it has not been created properly or maybe something in the get request is failing. Could you provide some screenshots or information about console requests of youyr web browser? |
|
When installing with helm, did you changed some values or did you installed everything by default? Maybe MongoDB is not connected properly to Ditto Extended API. If the connection is correct, you should get a list with all policies. |
It works now! I have reinstalled everything; it was probably some update-related issue! |
Perfect! So as the problem is already solved I will close the issue. |
My clarification in the other issue:
"Hello. I have same problem but creating a type page has the button but not in the policies' page where nothing is showing. The error in the console is :
url: 'http://IP_Extended_API/api/policies', bad request 400
accessing that url on browser gives a void message :
{
"message": {}
}
I'm deploying using Minikube. Grafana, the extended API, the Ditto NGINX and Mosquitto are accessible from Internet as I'm deploying on cloud with openstack instance with a floating IP. Grafana OpenTwin plugin is well connected to the Ip addresses of both Ditto NGINX and Extended API. Running API queries such as IP_Ditto_NGINX/api/2/whoami works, inserting and finding a new policy through curl to IP_Ditto_NGINX/api/2/policies/id_policy works. However, in the installation files, it is expected that I find default:basic_policy if I query Ditto NGINX, but it seems it is not their ""error": "policies:policy.notfound",".
I was thinking it could be a problem with mongodb not connected, but as long as I insert and I can find a test policy then it is connected. What could make policies not loading ?
Thank you."
Originally posted by @xxabdelxx in #6 (comment)
The text was updated successfully, but these errors were encountered: