-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sentry 9 deprecated the priv key in the DSN (#5)
This removes the requirement for the Sentry DSN to include the private key component and adds support for sending only the public key to Sentry 9 if no private key is included. It does not involve any breaking API changes.
- Loading branch information
1 parent
6f3c77b
commit 2d84dba
Showing
3 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ func TestDSN(t *testing.T) { | |
{"With a valid URL", "https://u:[email protected]/sentry/1", nil}, | ||
{"With a badly formatted URL", ":", ErrBadURL}, | ||
{"Without a public key", "https://example.com/sentry/1", ErrMissingPublicKey}, | ||
{"Without a private key", "https://[email protected]/sentry/1", ErrMissingPrivateKey}, | ||
{"Without a private key", "https://[email protected]/sentry/1", nil}, | ||
{"Without a project ID", "https://u:[email protected]", ErrMissingProjectID}, | ||
} | ||
|
||
|
@@ -60,7 +60,7 @@ func TestDSN(t *testing.T) { | |
d := &dsn{ | ||
PublicKey: "key", | ||
} | ||
So(d.AuthHeader(), ShouldEqual, "") | ||
So(d.AuthHeader(), ShouldEqual, "Sentry sentry_version=4, sentry_key=key") | ||
}) | ||
|
||
Convey("With valid keys", func() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ func TestHTTPTransport(t *testing.T) { | |
Convey("With a missing private key", func() { | ||
err := t.Send("https://[email protected]/sentry/1", p) | ||
So(err, ShouldNotBeNil) | ||
So(ErrMissingPrivateKey.IsInstance(err), ShouldBeTrue) | ||
So(err.Error(), ShouldEqual, "got http status 404, expected 200") | ||
}) | ||
|
||
Convey("When it cannot connect to the server", func() { | ||
|