Skip to content

Conversation

@krak3n
Copy link
Contributor

@krak3n krak3n commented May 26, 2015

This PR adds CircleCI token support in the same vein as the token feature on CodeCov allowing serving of private CircleCI builds.

See regex here: http://regexr.com/3b2v7

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused. Was having a default token never necessary?

Here's what I was told back then: #348 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token is used to query the circle REST API and isn't be needed for public project build states. If the project is private then you need a token to access the REST API to get the build state of the project.

So the example project is public and thus works without a token:

curl https://circleci.com/api/v1/project/BrightFlair/PHP.Gt\?limit\=1\&filter\=completed -H "Accept:application/json"

https://github.com/BrightFlair/PHP.Gt

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what if the example project is private? Will existing badges stop working?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@espadrine at the moment I think that the token is ignored, public projects wouldn't break if the example repo became private. For example I can put a random circle token on the end and the API responds normally:

curl https://circleci.com/api/v1/project/BrightFlair/PHP.Gt\?limit\=1\&filter\=completed\&circle-token\=foo -H "Accept:application/json"

Basically all this PR does is remove the ignored token by default and allow the user to pass their own token in for private projects.

@maletor
Copy link

maletor commented Jun 5, 2015

Perfecto!

@espadrine espadrine merged commit f46f6f3 into badges:master Jun 9, 2015
@espadrine
Copy link
Member

Thanks for contributing!

@krak3n krak3n deleted the feature/circleci-token branch June 10, 2015 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants