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

access_rules cannot configure repositories by 'file:///C:*/*/rule.json' on windows #332

Closed
alexanyang opened this issue Jan 8, 2020 · 16 comments

Comments

@alexanyang
Copy link

this issue is happened on windows 10 system,it may cased by incorrect string parse with url.Parse() method .that split string with ' : ',and make it wrong . The error message is as follows:

time="2020-01-08T15:43:39+08:00" level=error msg="Unable to update access rules from given location, changes will be ignored. Check the configuration or restart the service if the issue persists." error="parse file://\F:\aweso
meProject\bin\resource-server.json: invalid port ":\\awesomeProject\\bin\\resource-server.json" after host" file="file:///F:/awesomeProject/bin/resource-server.json"

@alexanyang
Copy link
Author

access_rules:
repositories:

  • file:///F:/awesomeProject/bin/resource-server.json

@aeneasr
Copy link
Member

aeneasr commented Jan 8, 2020

Ahhh...windows :D Could you try it with:

  • file:///F/awesomeProject/bin/resource-server.json
  • file:///F:/awesomeProject/bin/resource-server.json
  • file://F/awesomeProject/bin/resource-server.json

Thank you!

@aeneasr
Copy link
Member

aeneasr commented Jan 8, 2020

I checked on a windows machine and I believe that this should work: file://F:/awesomeProject/bin/resource-server.json

@alexanyang
Copy link
Author

I checked on a windows machine and I believe that this should work: file://F:/awesomeProject/bin/resource-server.json

I did try those all ,but it still not really work.that shows that
time="2020-01-09T08:59:46+08:00" level=error msg="Unable to update access rules from given location, changes will be ignored. Check the configuration or restart the service if the issue persists." error="parse file://F:\\awesomeProject\\bin\\resource-server.json: invalid port \":\\\\awesomeProject\\\\bin\\\\resource-server.json\" after host" file="file://F:/awesomeProject/bin/resource-server.json"
or
invalid character \"\\\\\" in host name" file="file://F/awesomeProject/bin/resource-server.json"

@alexanyang
Copy link
Author

alexanyang commented Jan 9, 2020

only - inline:// * can work on my computer

@aeneasr
Copy link
Member

aeneasr commented Jan 9, 2020

Do you know Golang? I don't have access to a Windows machine often so it's hard for me to figure out what's wrong. We'd happily accept a fix!

@alexanyang
Copy link
Author

alexanyang commented Jan 9, 2020

It still can work with configuration inline so that isnot mater for me to use.Thanks for your answer.
My leader plans to develop a product with Golang, by keto & oathkeeper & hydra & e.g , if the user of this product requires it can work on a windows machine,we may fix it in this year or not. I will contact you after we finished

@aeneasr
Copy link
Member

aeneasr commented Jan 10, 2020

Ok, thanks for letting me know and good luck :)

@alexanyang
Copy link
Author

Hello,brother.I do solve this issue.It is caused by a piece of unnecessary code in line 147-154 of the file
../oathkeeper/rule/fetcher_default.go;
I clean the code ,it works and affect nothing
the code as followed

//if e.path.Scheme == "file" { // u, err := url.Parse("file://" + filepath.Clean(strings.TrimPrefix(e.path.String(), "file://"))) // if err != nil { // return nil, err // } // // e.path = *u //}

@aeneasr
Copy link
Member

aeneasr commented Mar 3, 2020

Would you mind setting up a PR?

@alexanyang
Copy link
Author

it is my pleasure,I need your authentication

@aeneasr
Copy link
Member

aeneasr commented Mar 5, 2020

@alexanyang
Copy link
Author

I did not use this before ,I git clone successful and add all files,but cannot push it on master .it request a username and password for "https://gist.github.com" , here is my email :"[email protected]"

@aeneasr
Copy link
Member

aeneasr commented Mar 7, 2020

You need to fork this repository and push to the forked repository and then create a PR from the forked repository to here. The link I shared should explain this. I can not give you write rights on this repository as it is against company policy.

@alexanyang
Copy link
Author

sorry,I tried it many times,but failed. It just change a little and the code I had give to you , maybe you can fix this by yourself .

@aeneasr
Copy link
Member

aeneasr commented Mar 13, 2020

Sorry for my late reply, I will check out your patch code when I have access to a windows machine and will try to fix it.

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