maven-config-plugin error with userroles goal

yhuynh
Participant I

userroles.txtI'm getting a 403 forbidden when running : mvn apigee-config:userroles -Pprod -Dapigee.config.options=update (see attached file) when it tries to POST to <org>/userroles/user/resourcepermissions

This is the error i get:

POST https://api.enterprise.apigee.com/v1/organizations/yemhuynh-eval/userroles/user/resourcepermissions
accept: [application/json]
accept-encoding: [gzip]
authorization: [Bearer [Not shown in log]
content-type: application/json
[Request body] {"resourcePermission":null}
[ERROR] Apigee call failed 403 Forbidden

All other goals work fine, just not this one.

1 6 273
6 REPLIES 6

yhuynh
Participant I

I am generating the userroles file exactly the same format as in https://github.com/apigee/apigee-config-maven-plugin/blob/master/samples/EdgeConfig/resources/edge/o...

What i'm not sure of is, why is it doing a POST instead of a PUT?

All the userroles management API are POST. Please check this link.

Hi @yem huynh - we are working on a fix for that issue. It should be released later today. The new version 1.3.7 should be the one you should use once released. I will post an update here once its released. You just need to update the version in your pom file

Thank you. Also one thing i noticed when i dug into the plugin code it looks like when generating the payload for this api call it looks for a json field named resourcepermissions (all lower case) but the generated json i get from management api generates resourcePermissions (camel-case)

When i modified my userroles file and changed it to resourcepermissions i do see a payload now but it is still 403 response status code.

Yes - the endpoint to add multiple permissions is "resourcepermissions" and while fetching all the resource permissions for a role, it returns "resourcePermissions"

@yem huynh- v1.3.7 is released.Please try using this version