Skip to content

Commit

Permalink
Merge pull request #261 from IBM-Cloud/dev
Browse files Browse the repository at this point in the history
Promote dev to master
  • Loading branch information
jorge-ibm authored Sep 20, 2021
2 parents aeb0b24 + 4d0c0f4 commit 4e35a5b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
16 changes: 12 additions & 4 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2021-09-15T17:17:42Z",
"generated_at": "2021-09-16T21:05:25Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -206,26 +206,34 @@
"verified_result": null
},
{
"hashed_secret": "42be9b0e85dc9f0fcb42c69058b133fd23dfde2b",
"hashed_secret": "6a4b65a72c0da02a03007867d9838f4a256a384b",
"is_secret": false,
"is_verified": false,
"line_number": 21,
"type": "JSON Web Token",
"verified_result": null
},
{
"hashed_secret": "42be9b0e85dc9f0fcb42c69058b133fd23dfde2b",
"is_secret": false,
"is_verified": false,
"line_number": 27,
"type": "JSON Web Token",
"verified_result": null
},
{
"hashed_secret": "73f596843cdc77ecc6a0a4cdc5b5d89071ad1b79",
"is_secret": false,
"is_verified": false,
"line_number": 25,
"line_number": 31,
"type": "JSON Web Token",
"verified_result": null
},
{
"hashed_secret": "63a47776714d85556701c61dd731a302ed132385",
"is_secret": false,
"is_verified": false,
"line_number": 33,
"line_number": 47,
"type": "Hex High Entropy String",
"verified_result": null
}
Expand Down
2 changes: 1 addition & 1 deletion bluemix/authentication/iam/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
GrantTypeDelegatedRefreshToken authentication.GrantType = "urn:ibm:params:oauth:grant-type:delegated-refresh-token" // #nosec G101
GrantTypeIdentityCookie authentication.GrantType = "urn:ibm:params:oauth:grant-type:identity-cookie"
GrantTypeDerive authentication.GrantType = "urn:ibm:params:oauth:grant-type:derive"
GrantTypeCRToken authentication.GrantType = "urn:ibm:params:oauth:grant-type:cr-token"
GrantTypeCRToken authentication.GrantType = "urn:ibm:params:oauth:grant-type:cr-token" // #nosec G101
)

// Response types
Expand Down
1 change: 1 addition & 0 deletions bluemix/configuration/core_config/iam_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type IAMTokenInfo struct {
IAMID string `json:"iam_id"`
ID string `json:"id"`
RealmID string `json:"realmid"`
SessionID string `json:"session_id"`
Identifier string `json:"identifier"`
Firstname string `json:"given_name"`
Lastname string `json:"family_name"`
Expand Down
15 changes: 15 additions & 0 deletions bluemix/configuration/core_config/iam_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ var TestIAMTokenData = []string{
"Bearer eyJraWQiOiIyMDE3MTAzMC0wMDowMDowMCIsImFsZyI6IlJTMjU2In0.eyJpYW1faWQiOiJJQk1pZC0yNzAwMDZWOEhNIiwiaWQiOiJJQk1pZC0yNzAwMDZWOEhNIiwicmVhbG1pZCI6IklCTWlkIiwiaWRlbnRpZmllciI6IjI3MDAwNlY4SE0iLCJnaXZlbl9uYW1lIjoiT0UgUnVudGltZXMiLCJmYW1pbHlfbmFtZSI6IlN5c3RlbSBVc2VyIiwibmFtZSI6Ik9FIFJ1bnRpbWVzIFN5c3RlbSBVc2VyIiwiZW1haWwiOiJydHN5c3VzckBjbi5pYm0uY29tIiwic3ViIjoicnRzeXN1c3JAY24uaWJtLmNvbSIsImFjY291bnQiOnsiYnNzIjoiOGQ2M2ZiMWNjNWU5OWU4NmRkNzIyOWRkZGZmYzA1YTUifSwiaWF0IjoxNTE2MTc1MDA3LCJleHAiOjE1MTYxNzg2MDcsImlzcyI6Imh0dHBzOi8vaWFtLmJsdWVtaXgubmV0L2lkZW50aXR5IiwiZ3JhbnRfdHlwZSI6InVybjppYm06cGFyYW1zOm9hdXRoOmdyYW50LXR5cGU6YXBpa2V5Iiwic2NvcGUiOiJvcGVuaWQiLCJjbGllbnRfaWQiOiJieCJ9.CuSOKifh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NvdXJjZSIsCgkgICJpYW1faWQiOiAiY3JuLWNybjp2MTpzdGFnaW5nOnB1YmxpYzppYW0taWRlbnRpdHk6OmEvMThlMzAyMDc0OWNlNDc0NGIwYjQ3MjQ2NmQ2MWZkYjQ6OmNvbXB1dGVyZXNvdXJjZTpGYWtlLUNvbXB1dGUtUmVzb3VyY2UiLAoJICAibmFtZSI6ICJteV9jb21wdXRlX3Jlc291cmNlIgoJfSwKCSJhY2NvdW50IjogewoJICAiYm91bmRhcnkiOiAiZ2xvYmFsIiwKCSAgInZhbGlkIjogdHJ1ZSwKCSAgImJzcyI6ICJmYWtlX2JzcyIKCX0sCgkiaWF0IjogMTYyOTkyOTQ2MywKCSJleHAiOiAxNjI5OTMzMDYzLAoJImlzcyI6ICJodHRwczovL2lhbS5jbG91ZC5pYm0uY29tL2lkZW50aXR5IiwKCSJncmFudF90eXBlIjogInVybjppYm06cGFyYW1zOm9hdXRoOmdyYW50LXR5cGU6Y3ItdG9rZW4iLAoJInNjb3BlIjogImlibSBvcGVuaWQiLAoJImNsaWVudF9pZCI6ICJieCIKICB9.CuSOKifh4DvE__bjwDsn5BKmAHF2NaXznoiA1KG-2s2njbJs9nQdOJ3lkOnM77BqvLEpu2cwsmhi4Gsdy-MiJ6ACub0A5zyB-D95IXsGYa5tbFQBLbPpmFDAgAhLG5gXlVnU7nyIJN17Slm3pcWSNXEdWcsA1tgDkC9gQc_rpDhUfhnFeGA2LpvVMtRDolcOrbRuWN4NEbBOwdTbG5-6ijZ5Ag2z3lVmlQZ_6BLBCSVM8WlI8eIGICqCx0HYsmCiMlSqZ-4fkpg2DBYYYX_XsMQlamGynuPeoiBckJIyGEgsJD2egYN2bOUNLcn5htSCGxoJ4HJfXJ70_iCzmovb0w",
Expand All @@ -31,6 +37,15 @@ func TestNewIAMTokenInfo(t *testing.T) {
assert.Equal(t, tokenInfo.UserEmail, "[email protected]")
assert.Equal(t, tokenInfo.IAMID, "IBMid-270006V8HM")
assert.Equal(t, tokenInfo.Accounts.AccountID, "8d63fb1cc5e99e86dd7229dddffc05a5")
assert.Empty(t, tokenInfo.SessionID)
}

for _, token := range TestIAMTokenDataWithSession {
tokenInfo := NewIAMTokenInfo(token)
assert.Equal(t, tokenInfo.UserEmail, "[email protected]")
assert.Equal(t, tokenInfo.IAMID, "IBMid-270006V8HM")
assert.Equal(t, tokenInfo.Accounts.AccountID, "8d63fb1cc5e99e86dd7229dddffc05a5")
assert.Equal(t, "sessionNumber", tokenInfo.SessionID)
}
}
func TestNewIAMCRTokenInfo(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion bluemix/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package bluemix
import "fmt"

// Version is the SDK version
var Version = VersionType{Major: 0, Minor: 6, Build: 8}
var Version = VersionType{Major: 0, Minor: 6, Build: 9}

// VersionType describe version info
type VersionType struct {
Expand Down

0 comments on commit 4e35a5b

Please sign in to comment.