-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For analytics records, upload a singular product that was used for an…
… authorized operation. This replaces the existing functionality that picked a random matching product from the credential
- Loading branch information
Showing
8 changed files
with
27 additions
and
15 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
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
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 |
---|---|---|
|
@@ -42,6 +42,7 @@ func TestMetadataHeaders(t *testing.T) { | |
DeveloperEmail: "[email protected]", | ||
Scopes: []string{"scope1", "scope2"}, | ||
CustomAttributes: "{\"tier\":\"standard\"}", | ||
AnalyticsProduct: "prod1", | ||
} | ||
api := "api" | ||
opts = makeMetadataHeaders(api, authContext, true) | ||
|
@@ -66,6 +67,7 @@ func TestMetadataHeaders(t *testing.T) { | |
equal(headerEnvironment, authContext.Environment()) | ||
equal(headerOrganization, authContext.Organization()) | ||
equal(headerScope, strings.Join(authContext.Scopes, " ")) | ||
equal(headerAnalyticsProduct, authContext.AnalyticsProduct) | ||
|
||
api2, ac2 := h.decodeMetadataHeaders(headers) | ||
if api != api2 { | ||
|
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 |
---|---|---|
|
@@ -41,6 +41,7 @@ func TestEncodeMetadata(t *testing.T) { | |
DeveloperEmail: "[email protected]", | ||
Scopes: []string{"scope1", "scope2"}, | ||
CustomAttributes: "{\"tier\":\"standard\"}", | ||
AnalyticsProduct: "prod1", | ||
} | ||
api := "api" | ||
metadata := encodeExtAuthzMetadata(api, authContext, true) | ||
|
@@ -65,6 +66,7 @@ func TestEncodeMetadata(t *testing.T) { | |
equal(headerOrganization, authContext.Organization()) | ||
equal(headerScope, strings.Join(authContext.Scopes, " ")) | ||
equal(headerCustomAttributes, authContext.CustomAttributes) | ||
equal(headerAnalyticsProduct, authContext.AnalyticsProduct) | ||
|
||
api2, ac2 := h.decodeExtAuthzMetadata(metadata.GetFields()) | ||
if api != api2 { | ||
|
@@ -96,6 +98,7 @@ func TestEncodeMetadataAuthorizedField(t *testing.T) { | |
DeveloperEmail: "[email protected]", | ||
Scopes: []string{"scope1", "scope2"}, | ||
CustomAttributes: "", | ||
AnalyticsProduct: "prod1", | ||
} | ||
|
||
metadata := encodeExtAuthzMetadata("api", authContext, true) | ||
|