c82f568b2c
We were previously issuing both client certs and server certs with both extended key usages included. Split the Issue*() methods into separate methods for issuing server certs versus client certs so they can have different extended key usages tailored for each use case. Also took the opportunity to clean up the parameters of the Issue*() methods and New() methods to more closely match how we prefer to call them. We were always only passing the common name part of the pkix.Name to New(), so now the New() method just takes the common name as a string. When making a server cert, we don't need to set the deprecated common name field, so remove that param. When making a client cert, we're always making it in the format expected by the Kube API server, so just accept the username and group as parameters directly.
56 lines
1.8 KiB
Go
56 lines
1.8 KiB
Go
// Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: go.pinniped.dev/internal/issuer (interfaces: ClientCertIssuer)
|
|
|
|
// Package issuermocks is a generated GoMock package.
|
|
package issuermocks
|
|
|
|
import (
|
|
reflect "reflect"
|
|
time "time"
|
|
|
|
gomock "github.com/golang/mock/gomock"
|
|
)
|
|
|
|
// MockClientCertIssuer is a mock of ClientCertIssuer interface.
|
|
type MockClientCertIssuer struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockClientCertIssuerMockRecorder
|
|
}
|
|
|
|
// MockClientCertIssuerMockRecorder is the mock recorder for MockClientCertIssuer.
|
|
type MockClientCertIssuerMockRecorder struct {
|
|
mock *MockClientCertIssuer
|
|
}
|
|
|
|
// NewMockClientCertIssuer creates a new mock instance.
|
|
func NewMockClientCertIssuer(ctrl *gomock.Controller) *MockClientCertIssuer {
|
|
mock := &MockClientCertIssuer{ctrl: ctrl}
|
|
mock.recorder = &MockClientCertIssuerMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockClientCertIssuer) EXPECT() *MockClientCertIssuerMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// IssueClientCertPEM mocks base method.
|
|
func (m *MockClientCertIssuer) IssueClientCertPEM(arg0 string, arg1 []string, arg2 time.Duration) ([]byte, []byte, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "IssueClientCertPEM", arg0, arg1, arg2)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].([]byte)
|
|
ret2, _ := ret[2].(error)
|
|
return ret0, ret1, ret2
|
|
}
|
|
|
|
// IssueClientCertPEM indicates an expected call of IssueClientCertPEM.
|
|
func (mr *MockClientCertIssuerMockRecorder) IssueClientCertPEM(arg0, arg1, arg2 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IssueClientCertPEM", reflect.TypeOf((*MockClientCertIssuer)(nil).IssueClientCertPEM), arg0, arg1, arg2)
|
|
}
|