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

Fix ocmd tutorial #2285

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-ocmd-tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix the ocmd tutorial

Files: examples/ocmd
Instructions: https://reva.link/docs/tutorials/share-tutorial/#5-1-4-create-the-share
Issue: https://github.com/cs3org/reva/issues/2284
2 changes: 2 additions & 0 deletions examples/ocmd/ocmd-server-1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ driver = "json"
users = "users.demo.json"

[http]
enabled_services = ["ocmd"]
enabled_middlewares = ["providerauthorizer", "cors"]
address = "0.0.0.0:19001"

[http.services.dataprovider]
Expand Down
2 changes: 2 additions & 0 deletions examples/ocmd/ocmd-server-2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ driver = "json"
users = "users.demo.json"

[http]
enabled_services = ["ocmd"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm ok, I was under the impression that the ocmd service gets picked up by just having [http.services.ocmd] in the config...

Same for the providerauthorizer Middleware.

enabled_middlewares = ["providerauthorizer", "cors"]
address = "0.0.0.0:17001"

[http.services.dataprovider]
Expand Down
8 changes: 4 additions & 4 deletions examples/ocmd/users.demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"id": {
"opaque_id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"idp": "https://cernbox.cern.ch",
"idp": "cernbox.cern.ch",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id really should be a url. It may be compared to the oidc provider, which always is a url. Including the protocol.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By 'id' you mean the "idp" field in a UserId object? I agree that the cs3apis documentation is undecisive and seems to tend towards making it a URL, but reva's current providerauthorizer interceptor code clearly requires it to be a domain.

I'll propose a non-breaking change in the providerauthorizer code so that it strips the protocol (if present) from the user's idp string before comparing it to the provider's domain string.

I'll also create a PR on the c3apis repo to make this clearer.

"type": 1
},
"username": "einstein",
Expand All @@ -28,7 +28,7 @@
{
"id": {
"opaque_id": "f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c",
"idp": "https://cesnet.cz",
"idp": "cesnet.cz",
"type": 1
},
"username": "marie",
Expand All @@ -54,7 +54,7 @@
{
"id": {
"opaque_id": "932b4540-8d16-481e-8ef4-588e4b6b151c",
"idp": "https://example.org",
"idp": "example.org",
"type": 1
},
"username": "richard",
Expand All @@ -80,7 +80,7 @@
{
"id": {
"opaque_id": "932b4522-139b-4815-8ef4-42cdf82c3d51",
"idp": "https://example.com",
"idp": "example.com",
"type": 1
},
"username": "test",
Expand Down