Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce rootkey storage from bakeryv2 upstream #11082

Merged
merged 1 commit into from Jan 9, 2020

Conversation

wallyworld
Copy link
Member

Description of change

More progress on moving off bakeryv2-unstable.
Some tests are updated to use bakeryv2 and the mongo backed root key storage is also ported across.

QA steps

bootstrap a controller
clear local cookies
login

bakery, err := bakery.NewService(bakery.NewServiceParams{
Location: "juju model " + s.State.ModelUUID(),
Store: store,
b := bakery.New(bakery.BakeryParams{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Suggestion), give the b object a better name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only used a couple of lines below and "bakery" clashes with the package name. "bkry" or something seems worse?

Copy link
Member

@ycliuhw ycliuhw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice thanks!

build failed: seems one more file needs to be changed apiserver/bakeryutil/service.go;

c.Assert(err, jc.ErrorIsNil)

// The background thread that removes records runs every 60s.
// Give a little bit of leeway for loaded systems.
for i := 0; i < 90; i++ {
_, err = s.service.CheckAny([]macaroon.Slice{{mac}}, nil, nil)
_, _, err = s.bakery.Oven.VerifyMacaroon(context.TODO(), macaroon.Slice{mac.M()})
if err == nil {
time.Sleep(time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to current pr, but not sure if we can inject clock and mock for testing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sadly the clock is hard wired in the upstream repo

@wallyworld
Copy link
Member Author

$$merge$$

@wallyworld
Copy link
Member Author

@wallyworld
Copy link
Member Author

$$merge$$

@wallyworld wallyworld force-pushed the bakeryv2-storage branch 2 times, most recently from cc48db1 to e4170af Compare January 9, 2020 03:11
@wallyworld
Copy link
Member Author

$$merge$$

@wallyworld
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit c201f37 into juju:develop Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants