-
Notifications
You must be signed in to change notification settings - Fork 142
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
Support for Security v2 API #754
base: dev
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant new-line.
The functionality covers basic CRUD operations of new version of Security REST API.
Still few operations are not implemented.