diff options
| author | Shulhan <ms@kilabit.info> | 2023-11-10 12:26:01 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-11-10 12:53:36 +0700 |
| commit | 378facb96e877ed275a59d974ee9b69e06120a53 (patch) | |
| tree | fe930c06d3d306c872c15bf36d74a24dbb35a993 | |
| parent | d7ae2721b8268b1e2880656504f41d4ae94c902b (diff) | |
| download | easypki-378facb96e877ed275a59d974ee9b69e06120a53.tar.xz | |
all: fork of unmaintained "github.com/google/easypki"
Changes,
* Add Go module
* replace "github.com/codegangsta/cli" with "github.com/urfave/cli"
* Changes import path to this repository using the following command,
$ find . -type f -name "*.go" \
| xargs sed -i "s#github.com/google/easypki#git.sr.ht/~shulhan/easypki#g"
* Reformat all files using goimports
* Remove reference to Travis and CodeCov
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | .travis.yml | 13 | ||||
| -rw-r--r-- | README.md | 33 | ||||
| -rw-r--r-- | cmd/easypki/main.go | 11 | ||||
| -rw-r--r-- | example/client-auth/client-auth.go | 6 | ||||
| -rw-r--r-- | go.mod | 16 | ||||
| -rw-r--r-- | go.sum | 34 | ||||
| -rw-r--r-- | pkg/easypki/easypki.go | 4 | ||||
| -rw-r--r-- | pkg/easypki/easypki_test.go | 5 | ||||
| -rw-r--r-- | pkg/store/bolt.go | 5 | ||||
| -rw-r--r-- | pkg/store/bolt_test.go | 5 | ||||
| -rw-r--r-- | pkg/store/local.go | 25 | ||||
| -rw-r--r-- | pkg/store/local_test.go | 2 | ||||
| -rw-r--r-- | pkg/store/store.go | 2 |
14 files changed, 87 insertions, 77 deletions
@@ -1,3 +1,4 @@ -*~ **/main +*.html *.swp +*~ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 35dfb22..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go -sudo: false -go: - - 1.x - -before_install: - - go get -t -v ./... - -script: - - ./test.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) @@ -1,37 +1,14 @@ -[](https://travis-ci.org/google/easypki) -[](https://codecov.io/gh/google/easypki) - -easypki -====== +# easypki Easy Public Key Infrastructure intends to provide most of the components needed to manage a PKI, so you can either use the API in your automation, or use the CLI. -# API - -[](https://godoc.org/github.com/google/easypki) - -For the latest API: - -``` -import "gopkg.in/google/easypki.v1" -``` +This is a fork of https://github.com/google/easypki . -## Legacy API - -API below pkg/ has been rewritten to allow extensibility in terms of PKI -storage and better readability. - -If you used the legacy API that was only writing files to disk, a tag has been -applied so you can still import it: - -``` -import "gopkg.in/google/easypki.v0" -``` +[](https://pkg.go.dev/git.sr.ht/~shulhan/easypki) -# CLI +## CLI Current implementation of the CLI uses the local store and uses a structure compatible with openssl, so you are not restrained. @@ -81,6 +58,6 @@ private keys in `$PKI_ROOT/ca_name/keys/` For more info about available flags, checkout out the help `easypki -h`. -# Disclaimer +## Disclaimer This is not an official Google product. diff --git a/cmd/easypki/main.go b/cmd/easypki/main.go index bf55692..96ebafb 100644 --- a/cmd/easypki/main.go +++ b/cmd/easypki/main.go @@ -18,6 +18,7 @@ package main import ( "crypto/x509" "crypto/x509/pkix" + "encoding/pem" "log" "net" "os" @@ -26,12 +27,10 @@ import ( "strings" "time" - "encoding/pem" - - "github.com/codegangsta/cli" - "github.com/google/easypki/pkg/certificate" - "github.com/google/easypki/pkg/easypki" - "github.com/google/easypki/pkg/store" + "git.sr.ht/~shulhan/easypki/pkg/certificate" + "git.sr.ht/~shulhan/easypki/pkg/easypki" + "git.sr.ht/~shulhan/easypki/pkg/store" + "github.com/urfave/cli" ) const ( diff --git a/example/client-auth/client-auth.go b/example/client-auth/client-auth.go index 8b1e4bf..a28904d 100644 --- a/example/client-auth/client-auth.go +++ b/example/client-auth/client-auth.go @@ -10,11 +10,11 @@ import ( "os" "time" + "git.sr.ht/~shulhan/easypki/pkg/certificate" + "git.sr.ht/~shulhan/easypki/pkg/easypki" + "git.sr.ht/~shulhan/easypki/pkg/store" "github.com/boltdb/bolt" "github.com/go-yaml/yaml" - "github.com/google/easypki/pkg/certificate" - "github.com/google/easypki/pkg/easypki" - "github.com/google/easypki/pkg/store" ) func main() { @@ -0,0 +1,16 @@ +module git.sr.ht/~shulhan/easypki + +go 1.21 + +require ( + github.com/boltdb/bolt v1.3.1 + github.com/go-yaml/yaml v2.1.0+incompatible + github.com/google/easypki v1.1.0 + github.com/urfave/cli v1.22.14 +) + +require ( + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + golang.org/x/sys v0.14.0 // indirect +) @@ -0,0 +1,34 @@ +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= +github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= +github.com/google/easypki v1.1.0 h1:RgRJ49o+sDcSKN3TwVeSJhUOmQTjQcS85If0V4Xg55A= +github.com/google/easypki v1.1.0/go.mod h1:jqFtMfHDa5FJ3AZkSgTUWHixv+7OpCKWPGFshnOGRg8= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= +github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/easypki/easypki.go b/pkg/easypki/easypki.go index 84eb0d6..b428525 100644 --- a/pkg/easypki/easypki.go +++ b/pkg/easypki/easypki.go @@ -23,8 +23,8 @@ import ( "fmt" "time" - "github.com/google/easypki/pkg/certificate" - "github.com/google/easypki/pkg/store" + "git.sr.ht/~shulhan/easypki/pkg/certificate" + "git.sr.ht/~shulhan/easypki/pkg/store" ) const ( diff --git a/pkg/easypki/easypki_test.go b/pkg/easypki/easypki_test.go index 77a5858..f73ae8e 100644 --- a/pkg/easypki/easypki_test.go +++ b/pkg/easypki/easypki_test.go @@ -20,13 +20,12 @@ import ( "io/ioutil" "net" "os" + "reflect" "testing" "time" + "git.sr.ht/~shulhan/easypki/pkg/store" "github.com/boltdb/bolt" - "github.com/google/easypki/pkg/store" - - "reflect" ) func TestLocalE2E(t *testing.T) { diff --git a/pkg/store/bolt.go b/pkg/store/bolt.go index 4f4f5a9..710ba45 100644 --- a/pkg/store/bolt.go +++ b/pkg/store/bolt.go @@ -17,13 +17,12 @@ package store import ( "crypto/x509/pkix" "errors" + "fmt" "math/big" "time" - "fmt" - + "git.sr.ht/~shulhan/easypki/pkg/certificate" "github.com/boltdb/bolt" - "github.com/google/easypki/pkg/certificate" ) var ( diff --git a/pkg/store/bolt_test.go b/pkg/store/bolt_test.go index 6ae940d..d4acd7d 100644 --- a/pkg/store/bolt_test.go +++ b/pkg/store/bolt_test.go @@ -19,12 +19,11 @@ import ( "io/ioutil" "math/big" "os" - "testing" - "reflect" + "testing" + "git.sr.ht/~shulhan/easypki/pkg/certificate" "github.com/boltdb/bolt" - "github.com/google/easypki/pkg/certificate" ) func TestBolt(t *testing.T) { diff --git a/pkg/store/local.go b/pkg/store/local.go index 1895e83..58a2f5b 100644 --- a/pkg/store/local.go +++ b/pkg/store/local.go @@ -16,6 +16,7 @@ package store import ( "bufio" + "crypto/x509" "crypto/x509/pkix" "encoding/pem" "fmt" @@ -27,9 +28,7 @@ import ( "strings" "time" - "crypto/x509" - - "github.com/google/easypki/pkg/certificate" + "git.sr.ht/~shulhan/easypki/pkg/certificate" ) // Predifined directory names. @@ -317,16 +316,16 @@ func (l *Local) Revoked(caName string) ([]pkix.RevokedCertificate, error) { // InitCADir creates the basic structure of a CA subdirectory. // -// |- crlnumber -// |- index.txt -// |- index.txt.attr -// |- serial -// |- certs/ -// |- ca.crt -// |- name.crt -// |- keys/ -// |- ca.key -// |- name.key +// |- crlnumber +// |- index.txt +// |- index.txt.attr +// |- serial +// |- certs/ +// |- ca.crt +// |- name.crt +// |- keys/ +// |- ca.key +// |- name.key func InitCADir(path string) error { if _, err := os.Stat(path); err == nil { return nil diff --git a/pkg/store/local_test.go b/pkg/store/local_test.go index 61543a8..a3e6f39 100644 --- a/pkg/store/local_test.go +++ b/pkg/store/local_test.go @@ -24,7 +24,7 @@ import ( "reflect" "testing" - "github.com/google/easypki/pkg/certificate" + "git.sr.ht/~shulhan/easypki/pkg/certificate" ) var ( diff --git a/pkg/store/store.go b/pkg/store/store.go index fc39945..b6cdf42 100644 --- a/pkg/store/store.go +++ b/pkg/store/store.go @@ -19,7 +19,7 @@ import ( "crypto/x509/pkix" "math/big" - "github.com/google/easypki/pkg/certificate" + "git.sr.ht/~shulhan/easypki/pkg/certificate" ) // Store reprents a way to store a Certificate Authority. |
