jfrog-cli-core icon indicating copy to clipboard operation
jfrog-cli-core copied to clipboard

Missing "ForceNugetAuthentication" in repository template

Open cyan21 opened this issue 3 years ago • 3 comments

Describe the bug Not possible to create a nuget local or remote repository with the "ForceNugetAuthentication" option enabled. When running jfrog rt rpt, it doesn't offer this option in the "wizard"

To Reproduce

  1. Run jfrog rt rtc nuget-template.json
  2. Select "Create" template
  3. Select "local" or "remote"
  4. Select "nuget"

Expected behavior Being able to create a Nuget repository with all the option available on the UI

Screenshots If applicable, add screenshots to help explain your problem.

Versions

  • JFrog CLI core version: 2.8.3
  • JFrog CLI version (if applicable): 2.11.0
  • Artifactory version: 7.31.13

Additional context After investigating, it might be related to a typo error here shouldn't it be "ForceNugetAuthentication" instead of "ForceMavenAuthentication"

cyan21 avatar Feb 02 '22 06:02 cyan21

I have been provided with a workaround for this issue.

Create the following json :

{
  "key" : "ych-dotnet-release-local",
  "packageType" : "nuget",
  "rclass" : "local",
  "description" : "created by automation",
  "notes" : "test",
  "includesPattern" : "**/*",
  "excludesPattern" : "",
  "repoLayoutRef" : "nuget-default",
  "forceNugetAuthentication" : true
}
jfrog rt curl -XPUT -T nuget-test.json -H "Content-Type: application/json" api/repositories/ych-dotnet-release-local

Which works for local repositories, but not for virtual repositories where I get the error:

PS c:\jfrog>  jfrog rt curl -XPUT -T templates\nuget\virtual.json  -H "Content-Type: application/json" api/repositories/nuget-repository {
  "errors" : [ {
    "status" : 400,
    "message" : "Cannot invoke org.artifactory.repo.VirtualRepositoryConfigurationImpl.setRepositories on bean class 'class org.artifactory.repo.VirtualRepositoryConfigurationImpl' - [java.lang.ClassCastException@7ec47b87](mailto:java.lang.ClassCastException@7ec47b87) - had objects of type \"java.lang.String\" but expected signature \"java.util.List\"\n"
  } ]

bthharper avatar Feb 08 '22 23:02 bthharper

@cyan21 and @bthharper - Thanks for reporting this issue and sharing thr workaround. We added this task to our work plan and we'll share an update here once this become available.

eyalbe4 avatar Feb 09 '22 08:02 eyalbe4

@cyan21 @bthharper JFrog CLI 2.21.5 is released with a fix for this issue. We will appreciate your feedback about this fix. Thanks!

gailazar300 avatar Jul 25 '22 18:07 gailazar300