mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 09:19:39 +02:00
deployment: throw away golanglint-ci defaults (#439)
* deployment: throw away golanglint-ci defaults Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
dd54ce4481
commit
e82477ea5c
36 changed files with 101 additions and 3 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
"io/ioutil"
|
||||
)
|
||||
|
||||
// CertifcateFromBase64 returns an X509 pair from a base64 encoded blob.
|
||||
func CertifcateFromBase64(cert, key string) (*tls.Certificate, error) {
|
||||
decodedCert, err := base64.StdEncoding.DecodeString(cert)
|
||||
if err != nil {
|
||||
|
@ -24,11 +25,15 @@ func CertifcateFromBase64(cert, key string) (*tls.Certificate, error) {
|
|||
return &x509, err
|
||||
}
|
||||
|
||||
// CertificateFromFile given a certificate, and key file path, returns a X509
|
||||
// keypair.
|
||||
func CertificateFromFile(certFile, keyFile string) (*tls.Certificate, error) {
|
||||
cert, err := tls.LoadX509KeyPair(certFile, keyFile)
|
||||
return &cert, err
|
||||
}
|
||||
|
||||
// CertPoolFromBase64 takes a base64 encoded string and returns a new
|
||||
// X509 certificate pool.
|
||||
func CertPoolFromBase64(encPemCerts string) (*x509.CertPool, error) {
|
||||
b, err := base64.StdEncoding.DecodeString(encPemCerts)
|
||||
if err != nil {
|
||||
|
@ -37,6 +42,7 @@ func CertPoolFromBase64(encPemCerts string) (*x509.CertPool, error) {
|
|||
return bytesToCertPool(b)
|
||||
}
|
||||
|
||||
// CertPoolFromFile reads a file and returns an X509 certificate pool.
|
||||
func CertPoolFromFile(pemFile string) (*x509.CertPool, error) {
|
||||
b, err := ioutil.ReadFile(pemFile)
|
||||
if err != nil {
|
||||
|
|
3
internal/cryptutil/doc.go
Normal file
3
internal/cryptutil/doc.go
Normal file
|
@ -0,0 +1,3 @@
|
|||
// Package cryptutil provides cryptographic utility functions, complementing the
|
||||
// lower level abstractions found in the standard library.
|
||||
package cryptutil // import "github.com/pomerium/pomerium/internal/cryptutil"
|
|
@ -1,3 +1,5 @@
|
|||
// Package encoding defines interfaces shared by other packages that
|
||||
// convert data to and from byte-level and textual representations.
|
||||
package encoding // import "github.com/pomerium/pomerium/internal/encoding"
|
||||
|
||||
// MarshalUnmarshaler can both Marshal and Unmarshal a struct into and from a set of bytes.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package mock implements a mock implementation of MarshalUnmarshaler.
|
||||
package mock // import "github.com/pomerium/pomerium/internal/encoding/mock"
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package fileutil provides file utility functions, complementing the
|
||||
// lower level abstractions found in the standard library.
|
||||
package fileutil // import "github.com/pomerium/pomerium/internal/fileutil"
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
//go:generate statik -src=./assets -include=*.svg,*.html,*.css,*.js
|
||||
|
||||
// Package frontend handles the generation, and instantiation of Pomerium's
|
||||
// html templates.
|
||||
package frontend // import "github.com/pomerium/pomerium/internal/frontend"
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package client implements a gRPC client for the authorization service.
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
1
internal/grpc/cache/client/cache_client.go
vendored
1
internal/grpc/cache/client/cache_client.go
vendored
|
@ -1,3 +1,4 @@
|
|||
// Package client implements a gRPC client for the cache service.
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
3
internal/grpc/docs.go
Normal file
3
internal/grpc/docs.go
Normal file
|
@ -0,0 +1,3 @@
|
|||
// Package grpc provides gRPC utility functions, complementing the more
|
||||
// common ones in the github.com/grpc/grpc-go package
|
||||
package grpc // import "github.com/pomerium/pomerium/internal/grpc"
|
2
internal/grpcutil/doc.go
Normal file
2
internal/grpcutil/doc.go
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Package grpcutil contains utility functions for working with gRPC.
|
||||
package grpcutil // import "github.com/pomerium/pomerium/internal/grpcutil"
|
3
internal/httputil/docs.go
Normal file
3
internal/httputil/docs.go
Normal file
|
@ -0,0 +1,3 @@
|
|||
// Package httputil provides HTTP utility functions, complementing the more
|
||||
// common ones in the net/http package
|
||||
package httputil // import "github.com/pomerium/pomerium/internal/httputil"
|
|
@ -1,3 +1,6 @@
|
|||
// Package autocache implements a key value store (kv.Store) using autocache
|
||||
// which combines functionality from groupcache, and memberlist libraries.
|
||||
// For more details, see https://github.com/pomerium/autocache
|
||||
package autocache
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package bolt implements a key value store (kv.Store) using bbolt.
|
||||
// For more details, see https://github.com/etcd-io/bbolt
|
||||
package bolt
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package redis implements a key value store (kv.Store) using redis.
|
||||
// For more details, see https://redis.io/
|
||||
package redis
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package kv defines a Store interfaces that can be implemented by
|
||||
// datastores to provide key value storage capabilities.
|
||||
package kv
|
||||
|
||||
import "context"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package responsewriter contains helper functions that useful for
|
||||
// hooking into various parts of a response.
|
||||
package responsewriter
|
||||
|
||||
// The original work was derived from Goji's middleware, source:
|
||||
|
|
2
internal/sessions/cache/cache_store.go
vendored
2
internal/sessions/cache/cache_store.go
vendored
|
@ -1,3 +1,5 @@
|
|||
// Package cache provides a remote cache based implementation of session store
|
||||
// and loader. See pomerium's cache service for more details.
|
||||
package cache // import "github.com/pomerium/pomerium/internal/sessions/cache"
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package cookie provides a cookie based implementation of session store and loader.
|
||||
package cookie // import "github.com/pomerium/pomerium/internal/sessions/cookie"
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package header provides a request header based implementation of a
|
||||
// session loader.
|
||||
package header // import "github.com/pomerium/pomerium/internal/sessions/header"
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package mock provides a mock implementation of session store and loader.
|
||||
package mock // import "github.com/pomerium/pomerium/internal/sessions/mock"
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package queryparam provides a query param based implementation of a both
|
||||
// as session store and loader.
|
||||
package queryparam // import "github.com/pomerium/pomerium/internal/sessions/queryparam"
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package sessions handles the storage, management, and validation
|
||||
// of pomerium user sessions.
|
||||
package sessions // import "github.com/pomerium/pomerium/internal/sessions"
|
||||
|
||||
import (
|
||||
|
|
2
internal/telemetry/metrics/doc.go
Normal file
2
internal/telemetry/metrics/doc.go
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Package metrics contains support for OpenCensus distributed metrics.
|
||||
package metrics // import "github.com/pomerium/pomerium/internal/telemetry/metrics"
|
|
@ -154,7 +154,7 @@ func SetBuildInfo(service string) {
|
|||
registry.setBuildInfo(service)
|
||||
}
|
||||
|
||||
// Register non-view based metrics registry globally for export
|
||||
// RegisterInfoMetrics registers non-view based metrics registry globally for export
|
||||
func RegisterInfoMetrics() {
|
||||
metricproducer.GlobalManager().AddProducer(registry.registry)
|
||||
}
|
||||
|
|
2
internal/telemetry/trace/doc.go
Normal file
2
internal/telemetry/trace/doc.go
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Package trace contains support for OpenCensus distributed tracing.
|
||||
package trace // import "github.com/pomerium/pomerium/internal/telemetry/trace"
|
|
@ -11,6 +11,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// JaegerTracingProviderName is the name of the tracing provider Jaeger.
|
||||
JaegerTracingProviderName = "jaeger"
|
||||
)
|
||||
|
||||
|
@ -31,6 +32,7 @@ type TracingOptions struct {
|
|||
JaegerAgentEndpoint string `mapstructure:"tracing_jaeger_agent_endpoint"`
|
||||
}
|
||||
|
||||
// RegisterTracing creates a new trace exporter from TracingOptions.
|
||||
func RegisterTracing(opts *TracingOptions) error {
|
||||
var err error
|
||||
switch opts.Provider {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package tripper provides utility functions for working with the
|
||||
// http.RoundTripper interface.
|
||||
package tripper // import "github.com/pomerium/pomerium/internal/tripper"
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package urlutil provides utility functions for working with go urls.
|
||||
package urlutil // import "github.com/pomerium/pomerium/internal/urlutil"
|
||||
|
||||
import (
|
||||
|
@ -60,6 +61,7 @@ func ValidateURL(u *url.URL) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// DeepCopy creates a deep copy of a *url.URL
|
||||
func DeepCopy(u *url.URL) (*url.URL, error) {
|
||||
if u == nil {
|
||||
return nil, nil
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package version enables setting build-time version using ldflags.
|
||||
package version // import "github.com/pomerium/pomerium/internal/version"
|
||||
|
||||
import (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue