Skip to content
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

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft

Support for Security v2 API #754

wants to merge 2 commits into from

Conversation

dlorych
Copy link

@dlorych dlorych commented Apr 26, 2023

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.

The functionality covers basic CRUD operations of new version of Security REST API.
Still few operations are not implemented.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 26, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@dlorych
Copy link
Author

dlorych commented Apr 26, 2023

I have read the CLA Document and I hereby sign the CLA

@dlorych
Copy link
Author

dlorych commented Apr 26, 2023

recheck

@dlorych
Copy link
Author

dlorych commented Apr 26, 2023

@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.

@eyalbe4 eyalbe4 self-requested a review April 27, 2023 02:55
@eyalbe4 eyalbe4 added the safe to test Approve running integration tests on a pull request label May 29, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label May 29, 2023
@@ -0,0 +1,146 @@
package v2
Copy link
Contributor

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 {
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant new-line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants