Skip to content

Commit bfe8b18

Browse files
authored
Merge pull request #405 from IBM-Cloud/dev
Promote 1.4.0 to master
2 parents dd20f56 + 72058f3 commit bfe8b18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+271
-6724
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: go
22
dist: focal
33
go:
4-
- '1.21.x'
4+
- '1.22.x'
55
addons:
66
apt:
77
packages:

bluemix/authentication/iam/iam.go

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ import (
1414
)
1515

1616
const (
17-
defaultClientID = "bx"
18-
defaultClientSecret = "bx"
19-
defaultUAAClientID = "cf"
20-
defaultUAAClientSecret = ""
21-
crTokenParam = "cr_token"
22-
profileIDParam = "profile_id"
23-
profileNameParam = "profile_name"
24-
profileCRNParam = "profile_crn"
17+
defaultClientID = "bx"
18+
defaultClientSecret = "bx"
19+
crTokenParam = "cr_token"
20+
profileIDParam = "profile_id"
21+
profileNameParam = "profile_name"
22+
profileCRNParam = "profile_crn"
2523
)
2624

2725
// Grant types
@@ -40,7 +38,6 @@ const (
4038
// Response types
4139
const (
4240
ResponseTypeIAM authentication.ResponseType = "cloud_iam"
43-
ResponseTypeUAA authentication.ResponseType = "uaa"
4441
ResponseTypeIMS authentication.ResponseType = "ims_portal"
4542
ResponseTypeDelegatedRefreshToken authentication.ResponseType = "delegated_refresh_token" // #nosec G101 - this the API response grant type. Not a credential
4643
)
@@ -191,10 +188,6 @@ type Token struct {
191188
Scope string `json:"scope"`
192189
Expiry time.Time `json:"expiration"`
193190

194-
// Fields present when ResponseTypeUAA is set
195-
UAAToken string `json:"uaa_token"`
196-
UAARefreshToken string `json:"uaa_refresh_token"`
197-
198191
// Fields present when ResponseTypeIMS is set
199192
IMSUserID int64 `json:"ims_user_id"`
200193
IMSToken string `json:"ims_token"`
@@ -263,8 +256,6 @@ func DefaultConfig(iamEndpoint string) Config {
263256
SessionEndpoint: iamEndpoint + "/v1/sessions",
264257
ClientID: defaultClientID,
265258
ClientSecret: defaultClientSecret,
266-
UAAClientID: defaultUAAClientID,
267-
UAAClientSecret: defaultUAAClientSecret,
268259
}
269260
}
270261

@@ -285,13 +276,6 @@ func (c *client) GetToken(tokenReq *authentication.TokenRequest) (*Token, error)
285276
tokenReq.SetValue(v)
286277

287278
responseTypes := tokenReq.ResponseTypes()
288-
for _, t := range responseTypes {
289-
if t == ResponseTypeUAA {
290-
v.Set("uaa_client_id", c.config.UAAClientID)
291-
v.Set("uaa_client_secret", c.config.UAAClientSecret)
292-
break
293-
}
294-
}
295279
if len(responseTypes) == 0 {
296280
v.Set("response_type", ResponseTypeIAM.String())
297281
}

bluemix/authentication/uaa/uaa.go

Lines changed: 0 additions & 193 deletions
This file was deleted.

bluemix/configuration/config_helpers/helpers.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,6 @@ func PluginBinaryLocation(pluginName string) string {
7070
return executable
7171
}
7272

73-
func CFHome() string {
74-
return ConfigDir()
75-
}
76-
77-
func CFConfigDir() string {
78-
return filepath.Join(CFHome(), ".cf")
79-
}
80-
81-
func CFConfigFilePath() string {
82-
return filepath.Join(CFConfigDir(), "config.json")
83-
}
84-
8573
func UserHomeDir() string {
8674
if runtime.GOOS == "windows" {
8775
home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")

bluemix/configuration/core_config/bx_config.go

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ type BXConfigData struct {
4545
Profile models.Profile
4646
ResourceGroup models.ResourceGroup
4747
LoginAt time.Time
48-
CFEETargeted bool
49-
CFEEEnvID string
5048
PluginRepos []models.PluginRepo
5149
SSLDisabled bool
5250
Locale string
@@ -212,8 +210,7 @@ func (c *bxConfig) ConsoleEndpoints() (endpoints models.Endpoints) {
212210
func (c *bxConfig) CurrentRegion() (region models.Region) {
213211
c.read(func() {
214212
region = models.Region{
215-
MCCPID: c.data.RegionID,
216-
Name: c.data.Region,
213+
Name: c.data.Region,
217214
}
218215
})
219216
return
@@ -311,7 +308,7 @@ func (c *bxConfig) IsLoggedIn() bool {
311308
if token, refresh := c.IAMToken(), c.IAMRefreshToken(); token != "" || refresh != "" {
312309
iamTokenInfo := NewIAMTokenInfo(token)
313310
if iamTokenInfo.hasExpired() && refresh != "" {
314-
repo := newRepository(c, nil)
311+
repo := newRepository(c)
315312
if _, err := repo.RefreshIAMToken(); err != nil {
316313
return false
317314
}
@@ -510,20 +507,6 @@ func (c *bxConfig) SDKVersion() (version string) {
510507
return
511508
}
512509

513-
func (c *bxConfig) HasTargetedCFEE() (targeted bool) {
514-
c.read(func() {
515-
targeted = c.data.CFEETargeted
516-
})
517-
return
518-
}
519-
520-
func (c *bxConfig) CFEEEnvID() (envID string) {
521-
c.read(func() {
522-
envID = c.data.CFEEEnvID
523-
})
524-
return
525-
}
526-
527510
func (c *bxConfig) SetAPIEndpoint(endpoint string) {
528511
c.write(func() {
529512
c.data.APIEndpoint = endpoint
@@ -553,7 +536,6 @@ func (c *bxConfig) SetConsoleEndpoints(endpoint models.Endpoints) {
553536
func (c *bxConfig) SetRegion(region models.Region) {
554537
c.write(func() {
555538
c.data.Region = region.Name
556-
c.data.RegionID = region.MCCPID
557539
})
558540
}
559541

@@ -714,18 +696,6 @@ func (c *bxConfig) SetTrace(trace string) {
714696
})
715697
}
716698

717-
func (c *bxConfig) SetCFEETargeted(targeted bool) {
718-
c.write(func() {
719-
c.data.CFEETargeted = targeted
720-
})
721-
}
722-
723-
func (c *bxConfig) SetCFEEEnvID(envID string) {
724-
c.write(func() {
725-
c.data.CFEEEnvID = envID
726-
})
727-
}
728-
729699
func (c *bxConfig) SetCloudType(ctype string) {
730700
c.write(func() {
731701
c.data.CloudType = ctype

bluemix/configuration/core_config/bx_config_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,13 +534,11 @@ func checkUsageStats(enabled bool, timeStampExist bool, config core_config.Repos
534534

535535
func prepareConfigForCLI(cliConfigContent string, t *testing.T) core_config.Repository {
536536
ioutil.WriteFile("config.json", []byte(cliConfigContent), 0644)
537-
ioutil.WriteFile("cf_config.json", []byte(""), 0644)
538-
return core_config.NewCoreConfigFromPath("cf_config.json", "config.json", func(err error) {
537+
return core_config.NewCoreConfigFromPath("config.json", func(err error) {
539538
t.Fatal(err.Error())
540539
})
541540
}
542541

543542
func cleanupConfigFiles() {
544543
os.Remove("config.json")
545-
os.Remove("cf_config.json")
546544
}

0 commit comments

Comments
 (0)