Giter Site home page Giter Site logo

stashapicsharp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

stashapicsharp's Issues

Use the BitBucket Personal Access Token for authentication

BitBucket users can create a personal token to authenticate themselves without providing their user/password.

This is a scenario that we are willing to use. I've tried to modify the code for a pull request, but the constructors parameters of both StashClient and HttpCommunicationWorker are only string and conflict between Basic and Bearer authentication scenario. Any guidance on how you see doing it that you feel comfortable?

Thanks

StashClient not available on .NET Core

Currently using .NET Core 2.0, and I can't find the Atlassian.Stash namespace. I can't find the StashClient either. It looks as if it isn't exposed properly.

Stash Api using .NET 4.0

Hi,

I'm using VS 2012 with .NET 4.0, when installing nuget package (Install-Package Atlassian.Stash.Api -Version 1.0.15) i see the dependencies for Newtonsoft.Json (≥ 6.0.8) and Microsoft.AspNet.WebApi.Client (≥ 5.2.3) is using .NET framework 4.5. do you have backward compatible .NET framework stash api for .NET 4.0?

Cheers,
KS

Newtonsoft.Json v6

Please can you update this to align with the .Net Core reference... 11.02.

The one referenced is so old it causes reference errors when your project already contains a later version - the binding redirects don't work.

Using the StashClient for unsupported commands

This a feature suggestion: the ability to use the StashClient to run some BitBucket API commands/url that are not currently supported by this API. This would leverage the authentication and base URL from the client.

As an example, I could use the compare BB API with the client while the implementation is done ( #35 )

Update pull requests

It doesn't seem to be possible to use the PUT variants for pull requests to update them. Is that correct?

GetTAsync<Project> returns a list of projects.

GetTAsync returns a list of projects. It should return a single project.

var stashClient = new StashClient(...);
stashClient.GetTAsync<Project> (...)//This returns a list of projects, it should return a single project. 

Something like this should return a list of projects

stashClient.GetTAsync<List<Project>>(...)

Basic Authentication using SecureString

I see that the StashApiCSharp supports basic authentication using string for password . wouldn't it better to add support for SecureString in order to avoid possible risk of exposing sensitive data in managed memory?
I was thinking to add a new
public HttpCommunicationWorker(string baseUrl, string username, SecureString password)
{
var httpClientHandler = new HttpClientHandler
{
Credentials = new NetworkCredential(username, password)
};

        _httpClient = new HttpClient(httpClientHandler) {BaseAddress = new Uri(baseUrl)};

    }

Thanks,
Frank

Make StashApiCSharp more mockable

I would like to mock this API for unit tests. Are you open to the idea of adding interfaces to the StashClient and API objects? I would be willing to create a PR.

Improper instantiation of HttpClient

The HttpCommunicationWorker makes a new instance of the HttpClient every request. This is a bad practice, because it's intended to live for a longer and preferably reused for every request. @jlouros I would like to fix it, but I thought first run it through you to agree on this problem.

Sources:
https://blogs.msdn.microsoft.com/shacorn/2016/10/21/best-practices-for-using-httpclient-on-services/
https://docs.microsoft.com/en-us/azure/architecture/antipatterns/improper-instantiation/

Referenceing System.Net.Http.Formatting 4.0.0.0

I'm using this in a .NET Core project, which is targeting .NET Framework 4.5.2 and from this library (version 3.0.5) I'm getting errors that it's trying to load the above mentioned dependency - which doesn't exist on the machine.

Support Windows authentication

I see that the StashApiCSharp supports basic authentication. Please add support to add windows authentication as well. Such that we don't have to give our user name and passwords.

p.s: If I find time i'll implement it and issue a pull request.

Thanks,
Sriram

Support for non root url's

The current implementation does not support url's like this one: scm.company.com/stash. It assumes all deployments are on the root of the domain (like scm.company.com)

In order for those url's to be supported you need to add a trailing slash in the base url and then remove the starting slash from the requestUrl.

I have hacked this to make it work but it's not pretty in the current design

Rename this repository?

Since Atlassian has renamed Stash to Bitbucket Server shouldn't this repo also be renamed so it is easier for people to find it?

E.g. BitbucketApiCSharp or BitbucketServerApiCSharp

Improve handling of errors returned by bitbucket.

When creating a pull request via PullRequests.Create if the specified from branch / to branch is not found, bitbucket will return 404 not found. But the contents of the response will be a JSON structure that explains what was not found.

The issue is this JSON response is never read if the HTTP status code is 404.

The exception thrown is:
POST operation unsuccessful. Got HTTP status code 404.

I have modified a local checkout of the code to add reading the response data, which provides me the JSON error details as text in the exception:

Modified code - HttpCommunicationWorker, Line 97:

                string error = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                throw new Exception(string.Format("POST operation unsuccessful. Got HTTP status code '{0}' \nContent:\n{1}", httpResponse.StatusCode, error));

This is not ideal as it would be nice to deserialize the JSON error response to some sort of class structure.

Thanks.

Get commits for a branch or add branch compare functionnalities

I'm using this API for gathering some statistics on our BitBucket server for my team and I wanted to retrieved all commits (distinct across all branches).

Based on this answer, does a compare functionality or a GetAllCommits in the Branches API could be implemented?

What approach do you prefer? I may try to tackle it and submit a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.