-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature-oidc' into css-7081/use-secret-store
- Loading branch information
Showing
27 changed files
with
92 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,7 +168,7 @@ clouds: | |
c.Log(test.about) | ||
tmpfile, cleanupFunc := writeTempFile(c, test.cloudInfo) | ||
|
||
bClient := jimmtest.NewUserSessionLogin("[email protected]") | ||
bClient := jimmtest.NewUserSessionLogin(c, "[email protected]") | ||
// Running the command succeeds | ||
newCmd := cmd.NewAddCloudToControllerCommandForTesting(s.ClientStore(), bClient, test.cloudByNameFunc) | ||
var err error | ||
|
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 |
---|---|---|
|
@@ -24,7 +24,7 @@ var _ = gc.Suite(&crossModelQuerySuite{}) | |
func (s *crossModelQuerySuite) TestCrossModelQueryCommand(c *gc.C) { | ||
// Test setup. | ||
store := s.ClientStore() | ||
bClient := jimmtest.NewUserSessionLogin("alice") | ||
bClient := jimmtest.NewUserSessionLogin(c, "alice") | ||
|
||
s.AddController(c, "controller-2", s.APIInfo(c)) | ||
cct := names.NewCloudCredentialTag(jimmtest.TestCloudName + "/[email protected]/cred") | ||
|
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 |
---|---|---|
|
@@ -20,14 +20,14 @@ type grantAuditLogAccessSuite struct { | |
|
||
func (s *grantAuditLogAccessSuite) TestGrantAuditLogAccessSuperuser(c *gc.C) { | ||
// alice is superuser | ||
bClient := jimmtest.NewUserSessionLogin("alice") | ||
bClient := jimmtest.NewUserSessionLogin(c, "alice") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewGrantAuditLogAccessCommandForTesting(s.ClientStore(), bClient), "[email protected]") | ||
c.Assert(err, gc.IsNil) | ||
} | ||
|
||
func (s *grantAuditLogAccessSuite) TestGrantAuditLogAccess(c *gc.C) { | ||
// bob is not superuser | ||
bClient := jimmtest.NewUserSessionLogin("bob") | ||
bClient := jimmtest.NewUserSessionLogin(c, "bob") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewGrantAuditLogAccessCommandForTesting(s.ClientStore(), bClient), "[email protected]") | ||
c.Assert(err, gc.ErrorMatches, `unauthorized \(unauthorized access\)`) | ||
} |
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 |
---|---|---|
|
@@ -43,7 +43,7 @@ func (s *importModelSuite) TestImportModelSuperuser(c *gc.C) { | |
defer m.Close() | ||
|
||
// alice is superuser | ||
bClient := jimmtest.NewUserSessionLogin("alice") | ||
bClient := jimmtest.NewUserSessionLogin(c, "alice") | ||
_, err = cmdtesting.RunCommand(c, cmd.NewImportModelCommandForTesting(s.ClientStore(), bClient), "controller-1", m.ModelUUID()) | ||
c.Assert(err, gc.IsNil) | ||
|
||
|
@@ -70,7 +70,7 @@ func (s *importModelSuite) TestImportModelFromLocalUser(c *gc.C) { | |
c.Assert(err, gc.Equals, nil) | ||
|
||
// alice is superuser | ||
bClient := jimmtest.NewUserSessionLogin("alice") | ||
bClient := jimmtest.NewUserSessionLogin(c, "alice") | ||
_, err = cmdtesting.RunCommand(c, cmd.NewImportModelCommandForTesting(s.ClientStore(), bClient), "controller-1", mt.Id(), "--owner", "[email protected]") | ||
c.Assert(err, gc.IsNil) | ||
|
||
|
@@ -101,31 +101,31 @@ func (s *importModelSuite) TestImportModelUnauthorized(c *gc.C) { | |
defer m.Close() | ||
|
||
// bob is not superuser | ||
bClient := jimmtest.NewUserSessionLogin("bob") | ||
bClient := jimmtest.NewUserSessionLogin(c, "bob") | ||
_, err = cmdtesting.RunCommand(c, cmd.NewImportModelCommandForTesting(s.ClientStore(), bClient), "controller-1", m.ModelUUID()) | ||
c.Assert(err, gc.ErrorMatches, `unauthorized \(unauthorized access\)`) | ||
} | ||
|
||
func (s *importModelSuite) TestImportModelNoController(c *gc.C) { | ||
bClient := jimmtest.NewUserSessionLogin("bob") | ||
bClient := jimmtest.NewUserSessionLogin(c, "bob") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewImportModelCommandForTesting(s.ClientStore(), bClient)) | ||
c.Assert(err, gc.ErrorMatches, `controller not specified`) | ||
} | ||
|
||
func (s *importModelSuite) TestImportModelNoModelUUID(c *gc.C) { | ||
bClient := jimmtest.NewUserSessionLogin("bob") | ||
bClient := jimmtest.NewUserSessionLogin(c, "bob") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewImportModelCommandForTesting(s.ClientStore(), bClient), "controller-id") | ||
c.Assert(err, gc.ErrorMatches, `model uuid not specified`) | ||
} | ||
|
||
func (s *importModelSuite) TestImportModelInvalidModelUUID(c *gc.C) { | ||
bClient := jimmtest.NewUserSessionLogin("bob") | ||
bClient := jimmtest.NewUserSessionLogin(c, "bob") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewImportModelCommandForTesting(s.ClientStore(), bClient), "controller-id", "not-a-uuid") | ||
c.Assert(err, gc.ErrorMatches, `invalid model uuid`) | ||
} | ||
|
||
func (s *importModelSuite) TestImportModelTooManyArgs(c *gc.C) { | ||
bClient := jimmtest.NewUserSessionLogin("bob") | ||
bClient := jimmtest.NewUserSessionLogin(c, "bob") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewImportModelCommandForTesting(s.ClientStore(), bClient), "controller-id", "not-a-uuid", "spare-argument") | ||
c.Assert(err, gc.ErrorMatches, `too many args`) | ||
} |
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 |
---|---|---|
|
@@ -27,7 +27,7 @@ func (s *listAuditEventsSuite) TestListAuditEventsSuperuser(c *gc.C) { | |
s.AddModel(c, names.NewUserTag("[email protected]"), "model-2", names.NewCloudTag(jimmtest.TestCloudName), jimmtest.TestCloudRegionName, cct) | ||
|
||
// alice is superuser | ||
bClient := jimmtest.NewUserSessionLogin("alice") | ||
bClient := jimmtest.NewUserSessionLogin(c, "alice") | ||
context, err := cmdtesting.RunCommand(c, cmd.NewListAuditEventsCommandForTesting(s.ClientStore(), bClient)) | ||
c.Assert(err, gc.IsNil) | ||
c.Assert(cmdtesting.Stdout(context), gc.Matches, | ||
|
@@ -66,7 +66,7 @@ func (s *listAuditEventsSuite) TestListAuditEventsStatus(c *gc.C) { | |
s.AddModel(c, names.NewUserTag("[email protected]"), "model-2", names.NewCloudTag(jimmtest.TestCloudName), jimmtest.TestCloudRegionName, cct) | ||
|
||
// bob is not superuser | ||
bClient := jimmtest.NewUserSessionLogin("bob") | ||
bClient := jimmtest.NewUserSessionLogin(c, "bob") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewListAuditEventsCommandForTesting(s.ClientStore(), bClient)) | ||
c.Assert(err, gc.ErrorMatches, `unauthorized \(unauthorized access\)`) | ||
} |
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 |
---|---|---|
|
@@ -47,7 +47,7 @@ func (s *migrateModelSuite) TestMigrateModelCommandSuperuser(c *gc.C) { | |
mt2 := s.AddModel(c, names.NewUserTag("[email protected]"), "model-2", names.NewCloudTag(jimmtest.TestCloudName), jimmtest.TestCloudRegionName, cct) | ||
|
||
// alice is superuser | ||
bClient := jimmtest.NewUserSessionLogin("alice") | ||
bClient := jimmtest.NewUserSessionLogin(c, "alice") | ||
context, err := cmdtesting.RunCommand(c, cmd.NewMigrateModelCommandForTesting(s.ClientStore(), bClient), "controller-1", mt.String(), mt2.String()) | ||
c.Assert(err, gc.IsNil) | ||
c.Assert(cmdtesting.Stdout(context), gc.Matches, migrationResultRegex) | ||
|
@@ -61,13 +61,13 @@ func (s *migrateModelSuite) TestMigrateModelCommandFailsWithInvalidModelTag(c *g | |
s.AddModel(c, names.NewUserTag("[email protected]"), "model-2", names.NewCloudTag(jimmtest.TestCloudName), jimmtest.TestCloudRegionName, cct) | ||
|
||
// alice is superuser | ||
bClient := jimmtest.NewUserSessionLogin("alice") | ||
bClient := jimmtest.NewUserSessionLogin(c, "alice") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewMigrateModelCommandForTesting(s.ClientStore(), bClient), "controller-1", "model-001", "model-002") | ||
c.Assert(err, gc.ErrorMatches, ".* is not a valid model tag") | ||
} | ||
|
||
func (s *migrateModelSuite) TestMigrateModelCommandFailsWithMissingArgs(c *gc.C) { | ||
bClient := jimmtest.NewUserSessionLogin("alice") | ||
bClient := jimmtest.NewUserSessionLogin(c, "alice") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewMigrateModelCommandForTesting(s.ClientStore(), bClient), "myController") | ||
c.Assert(err, gc.ErrorMatches, "Missing controller and model tag arguments") | ||
} |
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 |
---|---|---|
|
@@ -61,7 +61,7 @@ func (s *modelStatusSuite) TestModelStatusSuperuser(c *gc.C) { | |
mt := s.AddModel(c, names.NewUserTag("[email protected]"), "model-2", names.NewCloudTag(jimmtest.TestCloudName), jimmtest.TestCloudRegionName, cct) | ||
|
||
// alice is superuser | ||
bClient := jimmtest.NewUserSessionLogin("alice") | ||
bClient := jimmtest.NewUserSessionLogin(c, "alice") | ||
context, err := cmdtesting.RunCommand(c, cmd.NewModelStatusCommandForTesting(s.ClientStore(), bClient), mt.Id()) | ||
c.Assert(err, gc.IsNil) | ||
c.Assert(cmdtesting.Stdout(context), gc.Matches, expectedModelStatusOutput) | ||
|
@@ -75,7 +75,7 @@ func (s *modelStatusSuite) TestModelStatus(c *gc.C) { | |
mt := s.AddModel(c, names.NewUserTag("[email protected]"), "model-2", names.NewCloudTag(jimmtest.TestCloudName), jimmtest.TestCloudRegionName, cct) | ||
|
||
// bob is not superuser | ||
bClient := jimmtest.NewUserSessionLogin("bob") | ||
bClient := jimmtest.NewUserSessionLogin(c, "bob") | ||
_, err := cmdtesting.RunCommand(c, cmd.NewModelStatusCommandForTesting(s.ClientStore(), bClient), mt.Id()) | ||
c.Assert(err, gc.ErrorMatches, `unauthorized \(unauthorized access\)`) | ||
} |
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
Oops, something went wrong.