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

Created service end point for NuGet #8

Merged

Conversation

innagarc
Copy link
Collaborator

@innagarc innagarc commented Mar 20, 2023

All Submissions:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.
  • I ran lint checks locally prior to submission.
  • Have you checked to ensure there aren't other open PRs for the same update/change?

What about the current behavior has changed?

Added the ability to create service connections for NuGet, supporting 3 types of authentication
image

Unit tests passing:

--- PASS: TestServiceEndpointNuget_ExpandFlatten_RoundtripPassword (0.00s)
--- PASS: TestServiceEndpointNuget_ExpandFlatten_RoundtripToken (0.00s)
--- PASS: TestServiceEndpointNuget_ExpandFlatten_RoundtripKey (0.00s)
--- PASS: TestServiceEndpointNuget_Create_DoesNotSwallowErrorToken (0.00s)
--- PASS: TestServiceEndpointNuget_Create_DoesNotSwallowErrorKey (0.00s)
--- PASS: TestServiceEndpointNuget_Create_DoesNotSwallowErrorPassword (0.00s)
--- PASS: TestServiceEndpointNuget_Read_DoesNotSwallowErrorToken (0.00s)
--- PASS: TestServiceEndpointNuget_Read_DoesNotSwallowErrorKey (0.00s)
--- PASS: TestServiceEndpointNuget_Read_DoesNotSwallowErrorPassword (0.00s)
--- PASS: TestServiceEndpointNuget_Delete_DoesNotSwallowErrorToken (0.00s)
--- PASS: TestServiceEndpointNuget_Delete_DoesNotSwallowErrorKey (0.00s)
--- PASS: TestServiceEndpointNuget_Delete_DoesNotSwallowErrorPassword (0.00s)
--- PASS: TestServiceEndpointNuget_Update_DoesNotSwallowErrorToken (0.00s)
--- PASS: TestServiceEndpointNuget_Update_DoesNotSwallowErrorKey (0.00s)
--- PASS: TestServiceEndpointNuget_Update_DoesNotSwallowErrorPassword (0.00s)

Acceptance tests passing:

--- PASS: TestAccServiceEndpointNuget_basic_token (66.30s)
--- PASS: TestAccServiceEndpointNuget_basic_key (66.33s)
--- PASS: TestAccServiceEndpointNuget_complete_usernamepassword (66.36s)
--- PASS: TestAccServiceEndpointNuget_complete_token (66.43s)
--- PASS: TestAccServiceEndpointNuget_RequiresImportErrorStepUsernamePassword (72.52s)
--- PASS: TestAccServiceEndpointNuget_complete_key (73.44s)
--- PASS: TestAccServiceEndpointNuget_basic_usernamepassword (73.60s)
--- PASS: TestAccServiceEndpointNuget_RequiresImportErrorStepToken (76.63s)
--- PASS: TestAccServiceEndpointNuget_RequiresImportErrorStepKey (77.22s)
--- PASS: TestAccServiceEndpointNuget_update_key (96.96s)
--- PASS: TestAccServiceEndpointNuget_update_token (100.65s)
--- PASS: TestAccServiceEndpointNuget_update_usernamepassword (100.68s)

Issue Number:

Does this introduce a change to go.mod, go.sum or vendor/?

  • Yes
  • No

Does this introduce a breaking change?

  • Yes
  • No

Any relevant logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Other information

@innagarc
Copy link
Collaborator Author

@davidcorrigan714 : Please review now. I believe that it is now completely ready to be submitted.

@davidcorrigan714 davidcorrigan714 self-requested a review March 28, 2023 14:54
Copy link
Collaborator

@davidcorrigan714 davidcorrigan714 left a comment

Choose a reason for hiding this comment

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

Need to remove all references to that hashing & diff functions.

innagarc and others added 10 commits March 29, 2023 05:33
…ndpoint_nuget.go

Co-authored-by: David Corrigan <47994662+davidcorrigan714@users.noreply.github.com>
…ndpoint_nuget.go

Co-authored-by: David Corrigan <47994662+davidcorrigan714@users.noreply.github.com>
…ndpoint_nuget.go

Co-authored-by: David Corrigan <47994662+davidcorrigan714@users.noreply.github.com>
…ndpoint_nuget.go

Co-authored-by: David Corrigan <47994662+davidcorrigan714@users.noreply.github.com>
…ndpoint_nuget.go

Co-authored-by: David Corrigan <47994662+davidcorrigan714@users.noreply.github.com>
…ndpoint_nuget.go

Co-authored-by: David Corrigan <47994662+davidcorrigan714@users.noreply.github.com>
…ndpoint_nuget.go

Co-authored-by: David Corrigan <47994662+davidcorrigan714@users.noreply.github.com>
…ndpoint_nuget.go

Co-authored-by: David Corrigan <47994662+davidcorrigan714@users.noreply.github.com>
…ndpoint_nuget.go

Co-authored-by: David Corrigan <47994662+davidcorrigan714@users.noreply.github.com>
@innagarc
Copy link
Collaborator Author

innagarc commented Mar 29, 2023

@davidcorrigan714 All requested changes addressed, Can you please help this PR get in, if fine?

@davidcorrigan714 davidcorrigan714 merged commit 98e9a55 into ni:ni-main Mar 29, 2023
if strings.EqualFold(*serviceEndpoint.Authorization.Scheme, "UsernamePassword") {
if _, ok := d.GetOk("authentication_basic"); !ok {
auth := make(map[string]interface{})
auth["username"] = ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

oops, username should be read in this case. With the Artifactory ones it doesn't work because the username field got marked as sensitive in the AzDO service connection extension by accident. JFrog will fix that in their next extension release. For all practical purposes it doesn't matter, but may want to fix it for upstreaming. @innagarc

Description: "The Nuget feed user name.",
Type: schema.TypeString,
Required: true,
Sensitive: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also probably shouldn't be sensitive if it's not in the service connection.

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