jira: update jira JWT subject per Atlassian's recent GDPR changes

Recently, Atlassian decided to remove `userKey` from JWT construction b/c they determined that it could contain personally identifiable information. They've since switched to the user account ID. This change updates the jira JWT to reflect these recent change.

Fixes golang/oauth2#312

Change-Id: I4bd66cf925fdf38e02dd665befb5ab5f19f14ee7
GitHub-Last-Rev: 344bb6046c
GitHub-Pull-Request: golang/oauth2#389
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/185081
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Shaun Dunning 2019-11-22 19:50:22 +00:00 коммит произвёл Brad Fitzpatrick
Родитель 0f29369cfe
Коммит 5d9234df09
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -81,7 +81,7 @@ func (js jwtSource) Token() (*oauth2.Token, error) {
exp := time.Duration(59) * time.Second exp := time.Duration(59) * time.Second
claimSet := &ClaimSet{ claimSet := &ClaimSet{
Issuer: fmt.Sprintf("urn:atlassian:connect:clientid:%s", js.conf.ClientID), Issuer: fmt.Sprintf("urn:atlassian:connect:clientid:%s", js.conf.ClientID),
Subject: fmt.Sprintf("urn:atlassian:connect:userkey:%s", js.conf.Subject), Subject: fmt.Sprintf("urn:atlassian:connect:useraccountid:%s", js.conf.Subject),
InstalledURL: js.conf.BaseURL, InstalledURL: js.conf.BaseURL,
AuthURL: js.conf.Endpoint.AuthURL, AuthURL: js.conf.Endpoint.AuthURL,
IssuedAt: time.Now().Unix(), IssuedAt: time.Now().Unix(),

Просмотреть файл

@ -30,7 +30,7 @@ func TestJWTFetch_JSONResponse(t *testing.T) {
conf := &Config{ conf := &Config{
BaseURL: "https://my.app.com", BaseURL: "https://my.app.com",
Subject: "userkey", Subject: "useraccountId",
Config: oauth2.Config{ Config: oauth2.Config{
ClientID: "super_secret_client_id", ClientID: "super_secret_client_id",
ClientSecret: "super_shared_secret", ClientSecret: "super_shared_secret",
@ -69,7 +69,7 @@ func TestJWTFetch_BadResponse(t *testing.T) {
conf := &Config{ conf := &Config{
BaseURL: "https://my.app.com", BaseURL: "https://my.app.com",
Subject: "userkey", Subject: "useraccountId",
Config: oauth2.Config{ Config: oauth2.Config{
ClientID: "super_secret_client_id", ClientID: "super_secret_client_id",
ClientSecret: "super_shared_secret", ClientSecret: "super_shared_secret",
@ -108,7 +108,7 @@ func TestJWTFetch_BadResponseType(t *testing.T) {
conf := &Config{ conf := &Config{
BaseURL: "https://my.app.com", BaseURL: "https://my.app.com",
Subject: "userkey", Subject: "useraccountId",
Config: oauth2.Config{ Config: oauth2.Config{
ClientID: "super_secret_client_id", ClientID: "super_secret_client_id",
ClientSecret: "super_shared_secret", ClientSecret: "super_shared_secret",
@ -145,7 +145,7 @@ func TestJWTFetch_Assertion(t *testing.T) {
conf := &Config{ conf := &Config{
BaseURL: "https://my.app.com", BaseURL: "https://my.app.com",
Subject: "userkey", Subject: "useraccountId",
Config: oauth2.Config{ Config: oauth2.Config{
ClientID: "super_secret_client_id", ClientID: "super_secret_client_id",
ClientSecret: "super_shared_secret", ClientSecret: "super_shared_secret",