Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Why does pacakge publishing require view permissions on user anonymous?

    Scheduled Pinned Locked Moved Support
    proget
    3 Posts 1 Posters 2 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      I found it quite strange that publishing requires view_feed permissions on user anonymous. Removing the permissions would cause server to prompt for credentials which causes buildmaster to fail.

      What I am trying to do is to publish to a ProGet feed from BuildMaster where the feed is private. But because of the permissioning issue I have to configure my feed to have view_feed permissions for anonymous. While no one is able to download the actual package, having the packages listed is also not ideal.

      Is there any solution for this?

      Product: ProGet
      Version: 3.6.1

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        You can specify the username/password in the -ApiKey with user:pass, thus logging in when doing a push.

        Alternatively, if you don't want to authenticate at all, just use ProGet's drop folder, and the package will be picked up.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          It is also worth noting that strictly speaking, pushing packages does not require the View privilege, that is a result of the NuGet client sending a GET request (i.e. "list") first before sending the PUT request to push the package -- it's the first request that gets 401ed. You can use the following PowerShell script to perform just the package upload:

          $FeedUrl = 'http://proget/nuget/Default'
          $FileName = 'C:\tmp\ProGet\packages\Package.1.0\Package.1.0.nupkg'
          $APIKey = 'Admin:Admin'
          
          #params([string]$FeedUrl, [string]$FileName, [string]$APIKey)
          
          $req = [System.Net.WebRequest]::CreateHttp($FeedUrl)
          $req.Method = 'PUT'
          $req.ServicePoint.Expect100Continue = $false
          
          If ($APIKey) {
              $req.Headers.Add('X-NuGet-APIKey', $APIKey)
          }
          
          $boundary = '---------------------------' + [System.Guid]::NewGuid().ToString('n')
          
          $req.ContentType = "multipart/form-data; boundary=""$boundary"""
          
          $utf8 = New-Object -TypeName System.Text.UTF8Encoding -ArgumentList ($false)
          
          $reqWriter = New-Object -TypeName System.IO.StreamWriter -ArgumentList ($req.GetRequestStream(), $utf8)
          
          $reqWriter.WriteLine("--$boundary")
          $reqWriter.WriteLine("Content-Disposition: form-data; name=""package""; filename=""package""")
          $reqWriter.WriteLine("Content-Type: application/octet-stream")
          $reqWriter.WriteLine()
          $reqWriter.Flush()
          
          $fileStream = [System.IO.File]::OpenRead($FileName)
          $fileStream.CopyTo($reqWriter.BaseStream)
          $fileStream.Close()
          
          $reqWriter.WriteLine()
          $reqWriter.Write("--$boundary--")
          
          $reqWriter.Dispose()
          
          $response = $req.GetResponse()
          $response.Dispose()
          
          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post
          Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation