Add macaroon authentication and bundle deployment (chicago-cubs merge) #3590

Merged
merged 192 commits into from Oct 23, 2015

Conversation

Projects
None yet
Owner

rogpeppe commented Oct 23, 2015

This merges the chicago-cubs feature branch into trunk.
This adds macaroon authentication support (along
with much API server cleanup) and support
for bundle deployment.

(Review request: http://reviews.vapour.ws/r/2991/)

frankban and others added some commits Aug 19, 2015

API endpoint for retrieving bundle changes.
Implement the GetBundleChanges API endpoint on the Client.
This is used to generate end return the list of changes
required to deploy a bundle (from the GUI perspective),
given a bundle YAML content.
Merge pull request #3035 from frankban/changes-endpoint
API endpoint for retrieving bundle changes.

Implement the GetBundleChanges API endpoint on the Client.
This is used to generate end return the list of changes
required to deploy a bundle (from the GUI perspective),
given a bundle YAML content.

(Review request: http://reviews.vapour.ws/r/2416/)
Merge pull request #3079 from frankban/changes-endpoint-fixes
Improve GetBundleChanges API tests.

This is already reviewed at http://reviews.vapour.ws/r/2416/ but I forgot to commit the changes.

(Review request: http://reviews.vapour.ws/r/2460/)
Merge pull request #3111 from frankban/unstable-packages
Migrate to unstable dependencies.

This branch also includes:
- fix tests making use of `charmstoretesting`, which does not exist anymore;
- sort imports;
- fix httpbakery usage to use the v1 package;
- fix cleaning up of some tests making use of mongo sessions;
- update dependencies file.

Please note that this is proposed for merging into the `guibundles` feature branch:
we plan to freeze unstable packages before including this work in core trunk.

(Review request: http://reviews.vapour.ws/r/2491/)
Merge pull request #3086 from makyo/resolve-url-1
Use ParseReference rather than InferURL

InferURL is [deprecated](https://github.com/juju/charm/blob/v5/url.go#L240) in favor of ParseReference, and future work around charm URLs will be taking place within ParseReference.

(Review request: http://reviews.vapour.ws/r/2467/)
Environs config
Added identity url and identity public key to the environs config.
Merge pull request #3173 from alesstimec/dependency-update
Migrating to charm.v6-unstable and macaroon-bakery.v1.



(Review request: http://reviews.vapour.ws/r/2550/)
Merge pull request #3174 from rogpeppe/037-apiserver-macaroon
apiserver: create macaroon and bakery service



(Review request: http://reviews.vapour.ws/r/2551/)
Merge pull request #3176 from mattyw/serialisation-comment
apiserver/authentication: Added comment about macaroon serialisation



(Review request: http://reviews.vapour.ws/r/2553/)
Merge pull request #3172 from mattyw/macaroon-login-flow
apiserver/authentication: Added macaroon authenticator



(Review request: http://reviews.vapour.ws/r/2549/)
api: trivial changes before landing
dependencies.tsv: Updated to latest juju/utils
Merge branch 'master' into master-update
Conflicts:
	apiserver/addresser/addresser_test.go
	apiserver/server_test.go
	dependencies.tsv
	state/upgrades.go
	upgrades/steps125.go
Merge pull request #3198 from mattyw/003-macaroon-login-flow
api,apiserver: Macaroon based login workflow



(Review request: http://reviews.vapour.ws/r/2576/)
Merge pull request #3204 from tasdomas/cubs-use-updated-charm.v6-unst…
…able

Use updated charm.v6-unstable in chicago-cubs.



(Review request: http://reviews.vapour.ws/r/2582/)
Merge pull request #3206 from mattyw/authenticator-for-tag-in-server
apiserver: AuthenticatorForTag now exists as a method on the apiserver



(Review request: http://reviews.vapour.ws/r/2584/)
Merge pull request #3207 from frankban/new-bundlechanges
Use new bundlechanges API.

The new bundlechanges API returns changes as interfaces rather than concrete structs. This branch reflects this new behavior.

(Review request: http://reviews.vapour.ws/r/2585/)
Bundle deployment base structure.
For now, the system just ads the charms, but local and cs bundles are
supported, and also bundles including non-public charms.
Provide a verify constraints function to the bundle deployer. Use an …
…interface for notifying bundle deployment progress.
Merge pull request #3249 from frankban/deploy-bundle-base
Bundle deployment base structure.

For now, the system just ads the charms, but local and cs bundles are
supported, and also bundles including non-public charms.

(Review request: http://reviews.vapour.ws/r/2628/)
bundle deployment: use a separate setServiceOptions and cover charm u…
…pgrade failures when a different user is provided.
Merge pull request #3251 from frankban/bundle-add-services
Bundle deployment: handle deploying/upgrading services.



(Review request: http://reviews.vapour.ws/r/2630/)
Bundle deployment: handle adding service relations.
Add relations between services if not already established.
Merge remote-tracking branch 'origin/master' into HEAD
The only conflicts were file deletions in master and import
path conflicts.

Conflicts:
	apiserver/adminv2_test.go
	apiserver/storage/package_test.go
	cmd/juju/commands/helptool.go
	cmd/juju/commands/publish.go
	dependencies.tsv
	juju/series/series_windows_test.go
	provider/maas/environ.go
	worker/uniter/filter/filter.go
	worker/uniter/filter/filter_test.go
	worker/uniter/filter/interface.go
	worker/uniter/metrics.go
	worker/uniter/modes.go
	worker/uniter/op_plumbing.go
	worker/uniter/operation/metrics_test.go
	worker/uniter/relation/dyingsource.go
	worker/uniter/relation/hookqueue_test.go
	worker/uniter/relation/livesource.go
	worker/uniter/relations.go
	worker/uniter/runner/context/contextfactory.go
	worker/uniter/runner/contextfactory_test.go
	worker/uniter/runner/export_test.go
	worker/uniter/runner/util_test.go
	worker/uniter/storage/source.go
	worker/uniter/storage/source_test.go
Merge pull request #3250 from rogpeppe/039-cubs-merge-master
merge master into chicago cubs feature branch

The only conflicts were import path changes and file deletions, both trivially resolved.

(Review request: http://reviews.vapour.ws/r/2629/)

fwereade and others added some commits Sep 10, 2015

network: make HostPort sorting stable
Sorting of HostPorts wasn't stable for instances with the same address
but different port numbers.

The bug is unlikely to be causing any problems within Juju at the
moment but is good to have correct for future uses of this
functionality.
lp1373516 - Change default ec2 instance to m3.medium
This PR changes the selection of ec2 instance types to follow
the following rules:

- m1 instances will only be selected if explicitly specified using
the instance-type=m1.* constraint

- if no constraints are specified, the default instance type will
be m3.medium

- if constraints are specified, m1 instance types which satisfy
the constraints will not be selected for deployment
network: added SelectInternalHostPorts
This is like SelectInternalHostPort but selects all the best candidate
addresses, instead of just one of them. The logic for selecting the
best matching addresses has been cleaned up and reworked in terms of
selecting multiple addresses.
cmd/jujud/agent: refactor primeAgent helper
Refactor primeAgent helper to reduce the size of a following diff.
agent: SetAPIHostPorts now uses all candidate addresses for each server
SetAPIHostPorts used to pick just one address for each API server. It
now writes all best-matched addresses (using the new
SelectInternalHostPorts).

Fixes LP #1497094.
Delete unneeded json and yaml spaces cmd methods
The spaces yaml and json marshalling methods do not seem to
actually be required. Deleting them causes no spaces cmd
tests to fail.
cmd/juju/commands: refactor bootstrap_test
Clean up bootstrap test a little to make it easier to merge my mega
change later.
cmd/juju/commands: refactor version.Current patching
This PR will make it easier to land my followup that changes the defintion of
version.Current from a version.Binary to a version.Number.
Merge pull request #3477 from rogpeppe/058-juju-names-changes
update to use latest juju/names changes

all: update for latest names changes

The names.UserTag.Username method gets renamed to Canonical.
The names.UserTag.Provider method gets renamed to Domain.
The names.LocalProvider constant gets renamed to names.LocalUserDomain.

(Review request: http://reviews.vapour.ws/r/2866/)
Merge pull request #3513 from alesstimec/chicago-cubs-guibundles-mast…
…er-updates-01

Updates from the latest blessed master to chicago cubs



(Review request: http://reviews.vapour.ws/r/2910/)
Merge pull request #3512 from rogpeppe/061-external-users
apiserver: allow external users to validate using macaroon authentication

We don't allow an external macaroon discharger to speak for any
locally created user. Since existing implementations do return
usernames with no domains, we automatically append a "@external"
suffix in that case so we can continue to work with them.


(Review request: http://reviews.vapour.ws/r/2909/)
Merge pull request #3522 from alesstimec/chicago-cubs-cmd-juju-comman…
…ds-cleanup-01

Housekeeping in the cmd/juju/commands package.



(Review request: http://reviews.vapour.ws/r/2919/)
Merge pull request #3524 from rogpeppe/062-fix-deploy-bundle-windows
cmd/juju/commands: fix deploy tests under windows

Under Windows, if call os.Open("local:foo"), it fails not with an os.IsNotExist
error but with another error ("The filename, directory name, or volume label syntax is incorrect").

We change the heuristic to ignore any error caused by opening the local file,
and always fall back to loading from a charm repository in this case.

Also fix a regression of the error printed by juju status.

(Review request: http://reviews.vapour.ws/r/2921/)
Merge pull request #3548 from rogpeppe/063-lazy-apicontext
cmd/envcmd: only make apiContext when we need one

This means that commands that don't make an API context will not
load and save the cookie jar, which was a problem in particular
for the juju plugins because any cookies a plugin was creating
were being overwritten by the juju wrapper.


(Review request: http://reviews.vapour.ws/r/2948/)
Merge remote-tracking branch 'origin/chicago-cubs' into HEAD
Conflicts:
	apiserver/apiserver.go
	cmd/juju/commands/bootstrap_test.go
	dependencies.tsv
	environs/config/config.go
	worker/fortress/util_test.go
	worker/logsender/worker.go
	worker/logsender/worker_test.go

No obviously controversial conflicts.

@rogpeppe rogpeppe changed the title from merge chicago cubs into master to Add macaroon authentication and bundle deployment (chicago-cubs merge) Oct 23, 2015

Member

mhilton commented Oct 23, 2015

LGTM

Owner

rogpeppe commented Oct 23, 2015

All commits have already been reviewed, and the feature branch is blessed, so merging without further ado.

Owner

rogpeppe commented Oct 23, 2015

$$merge$$

Contributor

jujubot commented Oct 23, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Oct 23, 2015

Build failed: Generating tarball failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/5206

Owner

rogpeppe commented Oct 23, 2015

$$merge$$

Contributor

jujubot commented Oct 23, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Member

frankban commented Oct 23, 2015

Spurious?
$$merge$$

Contributor

jujubot commented Oct 23, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Oct 23, 2015

Merge pull request #3590 from rogpeppe/064-merge-chicago-cubs-into-ma…
…ster

Add macaroon authentication and bundle deployment (chicago-cubs merge)

This merges the chicago-cubs feature branch into trunk.
This adds macaroon authentication support (along
with much API server cleanup) and support
for bundle deployment.


(Review request: http://reviews.vapour.ws/r/2991/)

@jujubot jujubot merged commit 7cfd394 into juju:master Oct 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment