Coder Social home page Coder Social logo

laravel-bitbucket's Introduction

Banner

What have I been up to recently?

I am the maintainer of the following popular repositories and organisations:

I have also been actively contributing to:

Newer projects:

These lists are by no means exhaustive!

Any questions, or want to get involved, please get in touch. ๐Ÿ˜

Sponsor my work

If you use any of my packages, please consider sponsoring me!

image

Links

laravel-bitbucket's People

Contributors

grahamcampbell avatar jazo avatar lazabogdan avatar ppelgrims avatar shanecp avatar

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  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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

laravel-bitbucket's Issues

The purpose of the package is not very clear

Hi.

I'm trying to understand what this package can do but it seems I have to read the whole docs and the codes first.

I think it would be helpful to document that. Actually, please do it.

gentlero/bitbucket-api version

This package is at version 1.0 at the moment, but the caret in composer.json prevents it from updating to this version. From the docs:

The ^ operator behaves very similarly but it sticks closer to semantic versioning, and will always allow non-breaking updates. For example ^1.2.3 is equivalent to >=1.2.3 <2.0.0 as none of the releases until 2.0 should break backwards compatibility. For pre-1.0 versions it also acts with safety in mind and treats ^0.3 as >=0.3.0 <0.4.0.

This is the recommended operator for maximum interoperability when writing library code.

Example: ^1.2.3

Do you reckon we could update this package to that version?

Tags

Hi there,

The bitbucket rest api has a method to get tags: /rest/api/latest/projects/<project>/repos/<repo>/tags

Is there a way to call that using this package?

Many thanks for any advice.

Oauth 2 Consumer

Is there any way to use the Bitbucket Oauth 2 consume key and secret credentials with this package?

Different credentials

Hi!
Can I use the package somehow with different credentials for every website user?

Thanks

Can't install on Laravel 7 - illuminate/contracts version conflict

I can't install graham-campbell/bitbucket, when i run:

composer require "graham-campbell/bitbucket:^9.0"

I have the following error:

    - graham-campbell/bitbucket v9.0.0 requires illuminate/contracts ^8.75 || ^9.0 -> found illuminate/contracts[v8.75.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev] but these were not loaded, likely because it conflicts with another require. 

A similar situation is when trying to install with commands:

composer require "graham-campbell/bitbucket:^9.0" -W
composer require graham-campbell/bitbucket:*

composer why illuminate/contracts returns:

graham-campbell/manager  v4.7.0   requires  illuminate/contracts (^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0)  
laravel/framework        v7.30.6  replaces  illuminate/contracts (self.version)                          
laravel/tinker           v2.4.2   requires  illuminate/contracts (^6.0|^7.0|^8.0)
spatie/laravel-backup    6.11.2   requires  illuminate/contracts (^5.8.15|^6.0|^7.0|^8.0)
vinkla/hashids           8.1.0    requires  illuminate/contracts (^7.0)

Refresh Token is required

Hi Graham,

This is a very good package thank you for this.

Although the Bitbucket access token expires after 1 hour and needs a refresh token.
I tried to send a post request to refresh the token but when I do that, the access token changes.

Let's say after creating an API consumer having these:

BITBUCKET_KEY
BITBUCKET_SECRET

When I authenticate and get a BITBUCKET_ACCESS_TOKEN, this token expires after 1 hour then I have to send another request to get an BITBUCKET_REFRESH_TOKEN then having this BITBUCKET_REFRESH_TOKEN sending another request will generate a new access token and the previous one won't work.

Apologies if I am missing some concept here, but it would be grateful if you could guide me.

Authentication via token, how I can get the token key?

Hi, thank for great project, I'm working with bitbucket and this is very helpful for me.

First, I'm try authentication via basic, everything is OK. But switch to token method, I can't find where is token code (I have try App passwords code, that's similar Personal access tokens in Github but is doesn't work).

I found this doc: https://gentlero.bitbucket.io/bitbucket-api/0.8/examples/authentication.html#oauth2-authorization-code-3-legged-flow, It say require user authentication via browser to get access_token. That seem not right way here.

For now, I write own a class OAuthAuthenticator use client_id, client_secret to authentication. It's worked for me.

And seem it's good method. Maybe need a pull-request for that?

Download a repository

Is there anyway to download a repository using this package? It's the last part of the puzzle I have yet to solve!

Resource not found error for the deployments endpoint

Hi!

I found an issue in the API client. Whenever I try to fetch a deployments list, I'm getting the following exception:

{
    "message": "Resource not found: There is no API hosted at this URL.",
    "exception": "Bitbucket\\Exception\\RuntimeException",
    "file": "/srv/app/vendor/bitbucket/client/src/HttpClient/Plugin/BitbucketExceptionThrower.php",
    "line": 76,
    "trace": [ ... ]
}

Here's how I'm trying to get the list from code:

$deployments = $this
    ->bitbucket
    ->repositories()
    ->workspaces($workspace)
    ->deployments($repository)
    ->list();

Technically, this code should work, but I think there might be an issue with generated URL for this specific endpoint. Here's the URL that I'm getting in code:

https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/deployments

The thing is, this URL just doesn't work without a trailing slash. I'm getting the following response when I'm trying to make a request in Postman:

GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/deployments

{
    "type": "error",
    "error": {
        "message": "Resource not found",
        "detail": "There is no API hosted at this URL.\n\nFor information about our API's, please refer to the documentation at: https://developer.atlassian.com/bitbucket/api/2/reference/"
    }
}

... and the same URL but with a trailing slash:

GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/deployments/

{
    "page": 1,
    "values": [
        {
            "type": "deployment",
            "deployable": {
                "type": "deployment_release",
                "uuid": "<>",
                "pipeline": {
                    "uuid": "<>",
                    "type": "pipeline"
                },
    ...

I guess we need a fix :)

JWT token problem

Check please src/Auth/Authenticator/JwtAuthenticator.php:44
I guess correct would be:

$client->authenticate(Client::AUTH_JWT, $config['token']);

received data format issue

Hello,

I'm using your codes in my application built on laravel 5.5, where I'm facing some problem, I'm trying to retrieve list of commit details for my repository and I'm unable to use the response format. I'm trying to do something like this:

$data = Bitbucket::api('Repositories\Commits')->all('***repo***user***', '***repo***name***', array(
            'branch' => 'master'
));
return $data

I'm getting a response which is not in JSON format:

HTTP/1.1 200 OK
Server: nginx
Vary: Authorization
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Date: Tue, 13 Feb 2018 09:21:41 GMT
X-Served-By: app-139
ETag: "7b8332218b7bc6b7c4a2f50e3ab9c45c"
X-Static-Version: 476dd7889f1a
X-Content-Type-Options: nosniff
X-Accepted-OAuth-Scopes: repository
X-Credential-Type: password
X-Render-Time: 1.31000494957
Connection: keep-alive
X-Request-Count: 141
X-Frame-Options: SAMEORIGIN
Last-Modified: Mon, 12 Feb 2018 20:17:03 GMT
X-Version: 476dd7889f1a
Content-Length: 71360


{"pagelen": 30, "values": [{"hash": "********9b580ff91967547d61*****", "repository": {"links": {"self": {"href": "https://api.bitbucket.org/2.0/repositories/********/*****"}, "html": {"href......

I've already tried return response()->json(['data' => $data], 200) which was giving me no data. I can see headers data is also coming, if I use json_decode($data) it is gives me error which clearly shows is not a JSON. How can I format this to a proper JSON response?

Installation Error on Laravel 6.2

Command
composer require "graham-campbell/bitbucket:^8.1" "guzzlehttp/guzzle:^7.4" "http-interop/http-factory-guzzle:^1.0"

Error

Problem 1
    - laravel/passport[v8.0.0, ..., 8.x-dev] require guzzlehttp/guzzle ^6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.4).
    - Root composer.json requires laravel/passport ^8.0 -> satisfiable by laravel/passport[v8.0.0, ..., 8.x-dev]

setPerPage() doesn't seem to work for repositories

Hi there!
I've been trying to get a certain amount of repositories from BitBucket by making use of the Laravel-Bitbucket package. According to the docs, it should be possible to define the amount of results you'd like to receive on different API endpoints by calling the setPerPage() function.

When doing so with the members endpoint like in the example below, I get the specified amount of results back, as expected:

$team = Bitbucket::teams('teamname');

$members = $team->members();
$members->setPerPage(20);
$members->list();

However, when doing the exact same thing for the repositories endpoint. I keep ending up with the default amount of 10 repositories per page instead of the specified amount (20 in the example below).

$team = Bitbucket::teams('teamname');

$repositories = $team->repositories();
$repositories->setPerPage(20);
$repositories->list();

Am I doing something wrong here or is this a bug?
Could you please look into this?

Thank you in advance!

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.