Skip to content
This repository has been archived by the owner on Oct 3, 2021. It is now read-only.

Commit

Permalink
Add new oauth2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-schi committed Mar 10, 2017
1 parent e001099 commit a74e721
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ If you want to import all projects instead of one or more specific projects use

monitor.phar import [organisation-slug] --sentry-url=https://sentry.domain.com --sentry-api-key=ewd7wg68e76gziefb9eb --project-blacklist=sentry --project-blacklist=my-test-project

The sentry-api-key is the new oauth2 key you can generate on the `api/` page.

### Show the diagram

Start the build-in server with the default address `http://localhost:8006`:
Expand Down
6 changes: 5 additions & 1 deletion src/Service/SentryClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public function get(SentryRequest $sentryRequest, $endpoint)
{
$stream = $this
->client
->get($sentryRequest->getBaseUrl() . $endpoint, ['auth' => [$sentryRequest->getApiKey(), '']])
->get($sentryRequest->getBaseUrl() . $endpoint, [
'headers' => [
'Authorization' => sprintf('Bearer %s', $sentryRequest->getApiKey())
]
])
->getBody()
->getContents();

Expand Down

0 comments on commit a74e721

Please sign in to comment.