Support for Security v2 API#754
Support for Security v2 API#754dlorych wants to merge 2 commits intojfrog:dev-deprecated-please-target-master-directlyfrom
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
|
@eyalbe4 Could you check the approach taken? I have been inspired by access project service and deprecated version of security API in artifactory services. Any suggestions welcome :) The next step is to work on other operations: add/remove user group membership, unlock user, etc. |
| @@ -0,0 +1,146 @@ | |||
| package v2 | |||
There was a problem hiding this comment.
Let's rempve the v2 package. and have this file as well as users.go directly umder access/services.
| GroupName string `json:"group_name"` | ||
| Uri string `json:"uri"` | ||
| } | ||
| type GroupList struct { |
There was a problem hiding this comment.
Missing new-line before type definition. There a few other places in the code added by this PR which have new-lines between functions / structs missing.
| if err != nil { | ||
| return err | ||
| } | ||
| url := fmt.Sprintf("%s/%s", gs.getBaseUrl(), params.Name) |
There was a problem hiding this comment.
You can use path.Join in this case. The same goes for a few other places in this PR.
| groupParams := getTestAccessGroupParams() | ||
| err := testAccessGroupService.Create(groupParams) | ||
| defer deleteAccessGroupAndAssert(t, groupParams.GroupDetails.Name) | ||
| assert.NoError(t, err) |
There was a problem hiding this comment.
This error assertion should be placed right after the line that returns the error (before the defer).
The same goes for the testUpdateAccessGroup function.
| groupNames = append(groupNames, v.GroupName) | ||
| } | ||
| assert.Contains(t, groupNames, groupParams.GroupDetails.Name) | ||
|
|
The functionality covers basic CRUD operations of new version of Security REST API.
Still few operations are not implemented.