Project

General

Profile

Task #2528

Story #2527: Verify AccessRights and ReplicationPolicy REST calls from Python CLI

Attempt to set access rights fails

Added by Andrew Pippin over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Andrew Pippin
Category:
d1_client_cli
Start date:
2012-03-26
Due date:
% Done:

100%

Milestone:
CCI-1.0.0
Product Version:
*
Story Points:
Sprint:

Description

Cannot set access rights via the CLI.

setaccess abp-20120326T1857Z
DEBUG baseURL: https://cn-dev-3.dataone.org/cn
DEBUG operation: PUT /cn/v1/accessRules/abp-20120326T1857Z
DEBUG headers: {'Content-Length': 513, 'Charset': 'utf-8', 'Content-Type': 'multipart/form-data; boundary=----------6B3C785C-6290-11DF-A355-A6ECDED72085_$', 'Accept': 'application/xml', 'User-Agent': 'pyd1/1.0.0c4 +http://dataone.org/'}
ERROR Unable to set access policy on: abp-20120326T1857Z
ERROR Error:
ERROR InvalidRequest: The 'serialVersion' must be provided as a parameter and was not.

MIME Multipart:

------------6B3C785C-6290-11DF-A355-A6ECDED72085_$
Content-Disposition: form-data; name="serialVersion"

1
------------6B3C785C-6290-11DF-A355-A6ECDED72085_$
Content-Disposition: form-data; name="accessPolicy"; filename="accessPolicy.xml"
Content-Type: application/xml

<?xml version="1.0" ?>publicread/ns1:accessPolicy
------------6B3C785C-6290-11DF-A355-A6ECDED72085_$--


Related issues

Related to Infrastructure - Task #2539: Incorrect serial version being used for setAccess Closed 2012-03-26
Related to Infrastructure - Bug #2526: Parameters retrieved incorrectly in CNResourceHandler Closed 2012-03-26

History

#1 Updated by Andrew Pippin over 12 years ago

  • Category set to d1_client_cli
  • Status changed from New to In Progress
  • Assignee set to Andrew Pippin

#2 Updated by Andrew Pippin over 12 years ago

CNAuthorization.setAccessPolicy() appears to be getting the serialVersion from the query string and not from the MIME Multipart as specified in the API:
http://mule1.dataone.org/ArchitectureDocs-current/apis/CN_APIs.html#CNAuthorization.setAccessPolicy

The following cURL worked:

curl -k -E ~/.ssh/pippin.pem --request PUT \
--form "accessPp.xml;filename=accessPolicy;type=application/xml" \
--trace trace.out \
https://cn-dev-3.dataone.org/cn/v1/accessRules/abp-20120326T1857Z?serialVersion=9

#3 Updated by Chris Jones over 12 years ago

This was addressed on 3/26/2012 in r7090 of CNResourceHandler in Metacat, but hadn't been deployed yet. It's now deployed in the DEV environment, and will be deployed in the SANDBOX environment in the next tagged RC.

#4 Updated by Andrew Pippin over 12 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

Now that Metacat's CNResourceHandler has been changed, the call succeeds.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)