-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from karimra/cert-api
add cert api
- Loading branch information
Showing
10 changed files
with
619 additions
and
29 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,21 @@ | ||
package cert | ||
|
||
import "github.com/openconfig/gnoi/cert" | ||
|
||
func NewCertCanGenerateCSRRequest(opts ...CertOption) (*cert.CanGenerateCSRRequest, error) { | ||
m := new(cert.CanGenerateCSRRequest) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, nil | ||
} | ||
|
||
func NewCertCanGenerateCSRResponse(opts ...CertOption) (*cert.CanGenerateCSRResponse, error) { | ||
m := new(cert.CanGenerateCSRResponse) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cert | ||
|
||
import "github.com/openconfig/gnoi/cert" | ||
|
||
func NewCertGenerateCSRRequest(opts ...CertOption) (*cert.GenerateCSRRequest, error) { | ||
m := new(cert.GenerateCSRRequest) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, nil | ||
} | ||
|
||
func NewCertGenerateCSRResponse(opts ...CertOption) (*cert.GenerateCSRResponse, error) { | ||
m := new(cert.GenerateCSRResponse) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cert | ||
|
||
import "github.com/openconfig/gnoi/cert" | ||
|
||
func NewCertGetCertificatesRequest(opts ...CertOption) (*cert.GetCertificatesRequest, error) { | ||
m := new(cert.GetCertificatesRequest) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, nil | ||
} | ||
|
||
func NewCertGetCertificatesResponse(opts ...CertOption) (*cert.GetCertificatesResponse, error) { | ||
m := new(cert.GetCertificatesResponse) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package cert | ||
|
||
import "github.com/openconfig/gnoi/cert" | ||
|
||
func NewCertInstallGenerateCSRRequest(opts ...CertOption) (*cert.InstallCertificateRequest, error) { | ||
m, err := NewCertGenerateCSRRequest(opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &cert.InstallCertificateRequest{ | ||
InstallRequest: &cert.InstallCertificateRequest_GenerateCsr{ | ||
GenerateCsr: m, | ||
}, | ||
}, nil | ||
} | ||
|
||
func NewCertInstallLoadCertificateRequest(opts ...CertOption) (*cert.InstallCertificateRequest, error) { | ||
m, err := NewCertLoadCertificateRequest(opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &cert.InstallCertificateRequest{ | ||
InstallRequest: &cert.InstallCertificateRequest_LoadCertificate{ | ||
LoadCertificate: m, | ||
}, | ||
}, nil | ||
} | ||
|
||
func NewCertInstallGenerateCSRResponse(opts ...CertOption) (*cert.InstallCertificateResponse, error) { | ||
m, err := NewCertGenerateCSRResponse(opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &cert.InstallCertificateResponse{ | ||
InstallResponse: &cert.InstallCertificateResponse_GeneratedCsr{ | ||
GeneratedCsr: m, | ||
}, | ||
}, nil | ||
} | ||
|
||
func NewCertInstallLoadCertificateResponse(opts ...CertOption) (*cert.InstallCertificateResponse, error) { | ||
m, err := NewCertLoadCertificateResponse(opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &cert.InstallCertificateResponse{ | ||
InstallResponse: &cert.InstallCertificateResponse_LoadCertificate{ | ||
LoadCertificate: m, | ||
}, | ||
}, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cert | ||
|
||
import "github.com/openconfig/gnoi/cert" | ||
|
||
func NewCertLoadCertificateRequest(opts ...CertOption) (*cert.LoadCertificateRequest, error) { | ||
m := new(cert.LoadCertificateRequest) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, nil | ||
} | ||
|
||
func NewCertLoadCertificateResponse(opts ...CertOption) (*cert.LoadCertificateResponse, error) { | ||
m := new(cert.LoadCertificateResponse) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cert | ||
|
||
import "github.com/openconfig/gnoi/cert" | ||
|
||
func NewCertLoadCertificateAuthorityBundleRequest(opts ...CertOption) (*cert.LoadCertificateAuthorityBundleRequest, error) { | ||
m := new(cert.LoadCertificateAuthorityBundleRequest) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, nil | ||
} | ||
|
||
func NewCertLoadCertificateAuthorityBundleResponse(opts ...CertOption) (*cert.LoadCertificateAuthorityBundleResponse, error) { | ||
m := new(cert.LoadCertificateAuthorityBundleResponse) | ||
err := apply(m, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return m, nil | ||
} |
Oops, something went wrong.