Skip to content

Commit

Permalink
Fix structured data in header
Browse files Browse the repository at this point in the history
The client is looking for an attribute named `require-token`; the
server was replying with `use-token-on-read`.  Now both are using
`require-token`.
  • Loading branch information
bbockelm committed Sep 2, 2023
1 parent 6fc6901 commit fef21d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion director.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func CreateNsFromDirectorResp(dirResp *http.Response, namespace *namespaces.Name
}
xPelicanNamespace := HeaderParser(pelicanNamespaceHdr[0])
namespace.Path = xPelicanNamespace["namespace"]
namespace.UseTokenOnRead, _ = strconv.ParseBool(xPelicanNamespace["use-token-on-read"])
namespace.UseTokenOnRead, _ = strconv.ParseBool(xPelicanNamespace["require-token"])
namespace.ReadHTTPS, _ = strconv.ParseBool(xPelicanNamespace["readhttps"])

var xPelicanAuthorization map[string]string
Expand Down
2 changes: 1 addition & 1 deletion director_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestCreateNsFromDirectorResp(t *testing.T) {
//Craft the Director's response
directorHeaders := make(map[string][]string)
directorHeaders["Link"] = []string{"<my-cache.edu:8443>; rel=\"duplicate\"; pri=1, <another-cache.edu:8443>; rel=\"duplicate\"; pri=2"}
directorHeaders["X-Pelican-Namespace"] = []string{"namespace=/foo/bar, readhttps=True, use-token-on-read=True"}
directorHeaders["X-Pelican-Namespace"] = []string{"namespace=/foo/bar, readhttps=True, require-token=True"}
directorHeaders["X-Pelican-Authorization"] = []string{"issuer=https://get-your-tokens.org, base-path=/foo/bar"}
directorBody := []byte(`{"key": "value"}`)

Expand Down

0 comments on commit fef21d5

Please sign in to comment.