-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworks pki infastructure in Juju for a structure.
- Removes existing code in Juju for cert management for a new pki package that prefers structured interfaces. - Key profiles for signing operations can be changed through a constant - PEM encoding for certificates has been upgrade to PKCS8 over PKCS1. This change will allow us to move to ECDSA signed certificates. - Prefers the use of multiple certificates to solve problems insteaf of a single controller certificate. - HTTP server tls config updated to support multiple certificates through the use of SNI. - APIServerCertUpdater worker changed to just offer a single Authority pki now. It does not have to transform certificates to tls.Certificate anymore for the http server. -- List of TODO's that can be performed a later date. - TODO upgrade to ECDSA certificates once we are using mongodb compiled with latest openssl across K8's platoforms. - TODO upgrade to use of tls.Certificate Supports* when we move to go 1.14 - TODO investigate the use of headers in PKCS8 encoding to support writing leaf groups out with certificates in pem format.
- Loading branch information
Showing
66 changed files
with
2,476 additions
and
1,419 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2018 Canonical Ltd. | ||
// Licensed under the AGPLv3, see LICENCE file for details. | ||
|
||
package caasadmission | ||
|
||
import ( | ||
"github.com/juju/errors" | ||
|
||
"github.com/juju/juju/api/base" | ||
"github.com/juju/juju/api/common" | ||
) | ||
|
||
// Client provides access to controller config | ||
type Client struct { | ||
facade base.FacadeCaller | ||
*common.ControllerConfigAPI | ||
} | ||
|
||
func NewClient(caller base.APICaller) (*Client, error) { | ||
_, isModel := caller.ModelTag() | ||
if !isModel { | ||
return nil, errors.New("expected model specific API connection") | ||
} | ||
facadeCaller := base.NewFacadeCaller(caller, "CAASAdmission") | ||
return &Client{ | ||
facade: facadeCaller, | ||
ControllerConfigAPI: common.NewControllerConfig(facadeCaller), | ||
}, nil | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2018 Canonical Ltd. | ||
// Licensed under the AGPLv3, see LICENCE file for details. | ||
|
||
package caasadmission | ||
|
||
import ( | ||
"github.com/juju/juju/apiserver/common" | ||
"github.com/juju/juju/apiserver/facade" | ||
) | ||
|
||
type Facade struct { | ||
auth facade.Authorizer | ||
*common.ControllerConfigAPI | ||
} | ||
|
||
func NewStateFacade(ctx facade.Context) (*Facade, error) { | ||
authorizer := ctx.Auth() | ||
if !authorizer.AuthMachineAgent() { | ||
return nil, common.ErrPerm | ||
} | ||
|
||
return &Facade{ | ||
auth: authorizer, | ||
ControllerConfigAPI: common.NewStateControllerConfig(ctx.State()), | ||
}, nil | ||
} |
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
Oops, something went wrong.