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

"CKAN Extension NGSI view can't communicate with Orion in same domain" #18

Open
saurabhjangir opened this issue Dec 22, 2017 · 4 comments

Comments

@saurabhjangir
Copy link

saurabhjangir commented Dec 22, 2017

In the below code, it seems that, connection from same domain is blocked, what is the purpose of this ?

        if proxy_enabled and not same_domain:
            if check_query(resource):
                if oauth_req == 'true' and not p.toolkit.c.user:
                    details = "</br></br>In order to see this resource properly, you need to be logged in.</br></br></br>"
                    f_details = "In order to see this resource properly, you need to be logged in."

File : ckanext/ngsiview/plugin.py : Line 157

@gzarrub
Copy link
Contributor

gzarrub commented Dec 25, 2017

Hi Saurabh

I really appreciate your interest at this extension, it was one of my first tasks when I was a trainee (I apologize for the lack of comments). I believe that this repository is discontinued, I lost my edition permissions almost two years ago and I think no one else kept on developing it, there is some forks of this repository that maybe can be more updated.

Regarding your PR and question, This extension allows to connect CKAN and FIWARE ContextBroker by letting the user makes simple queries from ckan to CB. It's been long time since I haven't review this code but I think that what same_domain does is to check if the resource url is a CKAN url or not, as I previously said the target of this extension is to connect CKAN and CB so there is no reason to make a request of that type to the own CKAN, this part of code tries to avoid this kind of requests.

same_domain = datapreview.on_same_domain(data_dict)
https://github.com/ckan/ckan/blob/master/ckan/lib/datapreview.py#L55

You would have a problem if for any reason you need that your CKAN and ContextBroker instances urls are the same, In that case maybe this part of code could need a change (not sure if just remove same_domain check is a proper change). Anyway I wont be able to merge your Pull requests cause I don't have the rigths anymore.

By making a fast review of the code there is something than could be wrong at than method, I'm not completly sure but I think this error messages are changed with each other.

https://github.com/telefonicaid/ckanext-ngsiview/blob/master/ckanext/ngsiview/plugin.py#L182

@saurabhjangir
Copy link
Author

saurabhjangir commented Dec 27, 2017

Hello @gzarrub ,
Thanks for your valuable response. As you don't have any access to this repository and you can't merge any further commits to this repository. Could you please copy this code to some other newly created repository and we can start changing/Merging new commits there ?
else you can provide me the authority to use your code to create new repository ?
By doing this we can start adding new functionality and Issue fixes to this extension, Is this fine with you ?

@gzarrub
Copy link
Contributor

gzarrub commented Dec 27, 2017

This is a public repository that uses a public license, you are able to manage your own copy of this repository without any problem, I suppose that you have to mantain the references to Telefonica I+D.

https://github.com/telefonicaid/ckanext-ngsiview/blob/master/LICENSE

If you keep on thinking adding changes to it, the best way to do that is that you fork it to your own account.

@saurabhjangir
Copy link
Author

Yes, I have created a Fork of this repository and i'll change the code accordingly.
Can you suggest me in which case both the URLs ( CKAN and Orion) would be the same?
I think this is only possible when resource URL is same as CKAN URL, which in turn means that resource URL is a link to CKAN not Orion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants