Skip to content

Commit

Permalink
chore: rename to siderolabs/crypto
Browse files Browse the repository at this point in the history
Also default branch updated to `main`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
  • Loading branch information
smira committed Sep 6, 2022
1 parent e9df1b8 commit 8570669
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 25 deletions.
9 changes: 6 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2022-06-22T12:59:39Z by kres 65530e7.
# Generated on 2022-09-06T19:01:35Z by kres 871f67c.

# options for analysis running
run:
Expand Down Expand Up @@ -36,7 +36,7 @@ linters-settings:
lines: 60
statements: 40
gci:
local-prefixes: github.com/talos-systems/crypto
local-prefixes: github.com/siderolabs/crypto
gocognit:
min-complexity: 30
ireturn:
Expand Down Expand Up @@ -65,7 +65,7 @@ linters-settings:
gofmt:
simplify: true
goimports:
local-prefixes: github.com/talos-systems/crypto
local-prefixes: github.com/siderolabs/crypto
golint:
min-confidence: 0.8
gomnd:
Expand Down Expand Up @@ -135,7 +135,10 @@ linters:
- goerr113
- gomnd
- gomoddirectives
- ireturn
- nestif
- nonamedreturns
- nosnakecase
- paralleltest
- tagliatelle
- thelper
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2022-06-22T12:59:39Z by kres 65530e7.
# Generated on 2022-09-06T19:01:35Z by kres 871f67c.

ARG TOOLCHAIN

# cleaned up specs and compiled versions
FROM scratch AS generate

# runs markdownlint
FROM node:18.2.0-alpine AS lint-markdown
FROM docker.io/node:18.8.0-alpine3.16 AS lint-markdown
WORKDIR /src
RUN npm i -g markdownlint-cli@0.31.1
RUN npm i -g markdownlint-cli@0.32.2
RUN npm i sentences-per-line@0.2.1
COPY .markdownlint.json .
COPY ./README.md ./README.md
Expand All @@ -23,12 +23,13 @@ FROM ${TOOLCHAIN} AS toolchain
RUN apk --update --no-cache add bash curl build-base protoc protobuf-dev

# build tools
FROM toolchain AS tools
FROM --platform=${BUILDPLATFORM} toolchain AS tools
ENV GO111MODULE on
ENV CGO_ENABLED 0
ENV GOPATH /go
ARG GOLANGCILINT_VERSION
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/${GOLANGCILINT_VERSION}/install.sh | bash -s -- -b /bin ${GOLANGCILINT_VERSION}
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCILINT_VERSION} \
&& mv /go/bin/golangci-lint /bin/golangci-lint
ARG GOFUMPT_VERSION
RUN go install mvdan.cc/gofumpt@${GOFUMPT_VERSION} \
&& mv /go/bin/gofumpt /bin/gofumpt
Expand Down Expand Up @@ -56,7 +57,7 @@ RUN FILES="$(gofumpt -l .)" && test -z "${FILES}" || (echo -e "Source code is no

# runs goimports
FROM base AS lint-goimports
RUN FILES="$(goimports -l -local github.com/talos-systems/crypto .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'goimports -w -local github.com/talos-systems/crypto .':\n${FILES}"; exit 1)
RUN FILES="$(goimports -l -local github.com/siderolabs/crypto .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'goimports -w -local github.com/siderolabs/crypto .':\n${FILES}"; exit 1)

# runs golangci-lint
FROM base AS lint-golangci-lint
Expand Down
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2022-06-22T12:59:39Z by kres 65530e7.
# Generated on 2022-09-06T19:01:35Z by kres 871f67c.

# common variables

Expand All @@ -11,13 +11,13 @@ ARTIFACTS := _out
REGISTRY ?= ghcr.io
USERNAME ?= siderolabs
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
GOLANGCILINT_VERSION ?= v1.46.2
GOLANGCILINT_VERSION ?= v1.49.0
GOFUMPT_VERSION ?= v0.3.1
GO_VERSION ?= 1.18
GOIMPORTS_VERSION ?= v0.1.10
PROTOBUF_GO_VERSION ?= 1.28.0
GO_VERSION ?= 1.19
GOIMPORTS_VERSION ?= v0.1.12
PROTOBUF_GO_VERSION ?= 1.28.1
GRPC_GO_VERSION ?= 1.2.0
GRPC_GATEWAY_VERSION ?= 2.10.0
GRPC_GATEWAY_VERSION ?= 2.11.3
VTPROTOBUF_VERSION ?= 0.3.0
DEEPCOPY_VERSION ?= v0.5.5
TESTPKGS ?= ./...
Expand All @@ -39,6 +39,7 @@ COMMON_ARGS += --build-arg=ARTIFACTS=$(ARTIFACTS)
COMMON_ARGS += --build-arg=SHA=$(SHA)
COMMON_ARGS += --build-arg=TAG=$(TAG)
COMMON_ARGS += --build-arg=USERNAME=$(USERNAME)
COMMON_ARGS += --build-arg=REGISTRY=$(REGISTRY)
COMMON_ARGS += --build-arg=TOOLCHAIN=$(TOOLCHAIN)
COMMON_ARGS += --build-arg=GOLANGCILINT_VERSION=$(GOLANGCILINT_VERSION)
COMMON_ARGS += --build-arg=GOFUMPT_VERSION=$(GOFUMPT_VERSION)
Expand All @@ -49,7 +50,7 @@ COMMON_ARGS += --build-arg=GRPC_GATEWAY_VERSION=$(GRPC_GATEWAY_VERSION)
COMMON_ARGS += --build-arg=VTPROTOBUF_VERSION=$(VTPROTOBUF_VERSION)
COMMON_ARGS += --build-arg=DEEPCOPY_VERSION=$(DEEPCOPY_VERSION)
COMMON_ARGS += --build-arg=TESTPKGS=$(TESTPKGS)
TOOLCHAIN ?= docker.io/golang:1.18-alpine
TOOLCHAIN ?= docker.io/golang:1.19-alpine

# help menu

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/talos-systems/crypto
===============================

[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/talos-systems/crypto)](https://pkg.go.dev/mod/github.com/talos-systems/crypto)
[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/siderolabs/crypto)](https://pkg.go.dev/mod/github.com/siderolabs/crypto)

Package provides wrappers around standard library `crypto/x509` and other `crypto/` packages
to simplify the usage by providing some defaults and ready to use recipes.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/talos-systems/crypto
module github.com/siderolabs/crypto

go 1.18
go 1.19

require (
github.com/stretchr/testify v1.7.3
Expand Down
2 changes: 1 addition & 1 deletion tls/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"sync"
"time"

talosx509 "github.com/talos-systems/crypto/x509"
talosx509 "github.com/siderolabs/crypto/x509"
)

// CertificateProvider describes an interface by which TLS certificates may be managed.
Expand Down
2 changes: 1 addition & 1 deletion x509/fingerprint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"encoding/pem"
"testing"

"github.com/talos-systems/crypto/x509"
"github.com/siderolabs/crypto/x509"
)

const certPEM1 = `
Expand Down
6 changes: 3 additions & 3 deletions x509/x509.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"encoding/pem"
"errors"
"fmt"
"io/ioutil"
"math/big"
"net"
"os"
"strings"
"time"
)
Expand Down Expand Up @@ -661,14 +661,14 @@ func NewKeyPair(ca *CertificateAuthority, setters ...Option) (*KeyPair, error) {
func NewCertificateAndKeyFromFiles(crt, key string) (*PEMEncodedCertificateAndKey, error) {
p := &PEMEncodedCertificateAndKey{}

crtBytes, err := ioutil.ReadFile(crt)
crtBytes, err := os.ReadFile(crt)
if err != nil {
return nil, err
}

p.Crt = crtBytes

keyBytes, err := ioutil.ReadFile(key)
keyBytes, err := os.ReadFile(key)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion x509/x509_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"

"github.com/talos-systems/crypto/x509"
"github.com/siderolabs/crypto/x509"
)

func TestNewKeyPair(t *testing.T) {
Expand Down

0 comments on commit 8570669

Please sign in to comment.