Repository navigation
Added an option to the publish window to use Credentials. - #256
Conversation
| } | ||
| } | ||
|
|
||
| private void UsePAT_ToolTipOpening(object sender, System.Windows.Controls.ToolTipEventArgs e) |
There was a problem hiding this comment.
None at all. Probably i misclicked something on the designer and generated this handler.
Will fix that.
There was a problem hiding this comment.
Pushed the file with the removed code. Thanks for the head up!
| if (_useApiKey != value) | ||
| { | ||
| _useApiKey = value; | ||
| OnPropertyChanged("UseApiKey"); |
There was a problem hiding this comment.
nameof can be used, it's a compiler feature.
There was a problem hiding this comment.
I'm not familiar with the nameof keyword. I'll look into it and implement it
There was a problem hiding this comment.
| private bool? _publishAsUnlisted = true; | ||
| private bool? _appendV2ApiToUrl = true; | ||
| private bool? _useApiKey = true; | ||
| private bool? _unlistPreviousVersions = false; |
There was a problem hiding this comment.
why do we need this change?
There was a problem hiding this comment.
We don't. I started working on another issue when I found the vsts bug. That _unlistPreviousVersions shouldn't be there.
I'll remove it
| Content="API Key" | ||
| ToolTip="Use this when only an API Key is required" | ||
| /> | ||
| <RadioButton x:Name="UsePAT" |
There was a problem hiding this comment.
I prefer to use the term "AccessToken" instead of PAT as we also have "UseAccessToken"
There was a problem hiding this comment.
One thing that i noticed is that i'm using VSTS as a reference.
VSTS doesn't require a username, just the Personal Access Token as a password in the credentials.
Right now i'm sending "PAT" in the username.
Maybe we should let the user specify actual credentials? Just in case, we are limiting the scope for VSTS and missing others.
(I have this change ready)
There was a problem hiding this comment.
Maybe we should let the user specify actual credentials? Just in case, we are limiting the scope for VSTS and missing others.
that is indeed better :)
|
Well I created a VSTS Project and a Package Feed. |
|
Modified the publish window as @304NotModified suggested. Now you can add credentials to the push |
|
But how does this new implementation allow you to use a PAT? |
|
Just as the nuget console. You write the Pat in the password field, and writing anything in the username https://docs.microsoft.com/es-es/vsts/package/nuget/nuget-exe#add-a-feed-to-nuget-2 |
|
testing now |
Modified the GalleryServer to use that
Renamed those strings to nameof
Created two different PushPackage methodsand two DeletePackageFromServer methods in GalleryServer
208258c to
38248a4
Compare
|
@ironicnet @304NotModified FYI, I did a rebase off of master, so you may need to do a hard reset or re-get this PR branch again. |
Sorry but i'm not that experienced in Github GUI. This is something you need me to do? Or is something i should do in my branch to get it updated? |
|
Nope, already merged in. The latest CI build appxbundle has it and it'll be in the next release. |


Added an option to the publish window so we can choose to send the request with the default credentials or setting the Personal Access Token in the credential.
I think that this fixes #58 . Although I think that the sources should have a way to identify which kind of authentication to use.
I don't know if i broke any coding / design guideline as I didn't see any guide for contributing. I just followed some code.

Also, didn't find any unit test or test project to add tests to it.
Tested it against our VSTS and worked well.
Preview of the window: