This commit is contained in:
Eric Chiang 2016-08-10 22:31:42 -07:00
parent 1cbb7700d8
commit bfe560ee21
30 changed files with 52 additions and 52 deletions

View File

@ -4,8 +4,8 @@ MAINTAINER Eric Chiang <eric.chiang@coreos.com>
RUN apk add --update ca-certificates RUN apk add --update ca-certificates
COPY bin/poke /poke COPY bin/dex /dex
ENTRYPOINT ["/poke"] ENTRYPOINT ["/dex"]
CMD ["version"] CMD ["version"]

View File

@ -73,7 +73,7 @@ type RemoteIdentity struct {
`UserID` fields will be added to the `AuthRequest`, `AuthCode` and `RefreshToken` `UserID` fields will be added to the `AuthRequest`, `AuthCode` and `RefreshToken`
structs. When a user logs in successfully through a connector structs. When a user logs in successfully through a connector
[here](https://github.com/coreos/poke/blob/95a61454b522edd6643ced36b9d4b9baa8059556/server/handlers.go#L227), [here](https://github.com/coreos/dex/blob/95a61454b522edd6643ced36b9d4b9baa8059556/server/handlers.go#L227),
the server will attempt to either get the user, or create one if none exists with the server will attempt to either get the user, or create one if none exists with
the remote identity. the remote identity.

View File

@ -1,11 +1,11 @@
PROJ=poke PROJ=dex
ORG_PATH=github.com/coreos ORG_PATH=github.com/coreos
REPO_PATH=$(ORG_PATH)/$(PROJ) REPO_PATH=$(ORG_PATH)/$(PROJ)
export PATH := $(PWD)/bin:$(PATH) export PATH := $(PWD)/bin:$(PATH)
VERSION=$(shell ./scripts/git-version) VERSION=$(shell ./scripts/git-version)
DOCKER_REPO=quay.io/ericchiang/poke DOCKER_REPO=quay.io/ericchiang/dex
DOCKER_IMAGE=$(DOCKER_REPO):$(VERSION) DOCKER_IMAGE=$(DOCKER_REPO):$(VERSION)
export GOBIN=$(PWD)/bin export GOBIN=$(PWD)/bin
@ -17,10 +17,10 @@ LD_FLAGS="-w -X $(REPO_PATH)/version.Version=$(VERSION)"
GOOS=$(shell go env GOOS) GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH) GOARCH=$(shell go env GOARCH)
build: bin/poke bin/example-app build: bin/dex bin/example-app
bin/poke: FORCE bin/dex: FORCE
@go install -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/poke @go install -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/dex
bin/example-app: FORCE bin/example-app: FORCE
@go install -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/example-app @go install -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/example-app
@ -43,7 +43,7 @@ lint:
done done
.PHONY: docker-build .PHONY: docker-build
docker-build: bin/poke docker-build: bin/dex
@docker build -t $(DOCKER_IMAGE) . @docker build -t $(DOCKER_IMAGE) .
.PHONY: docker-push .PHONY: docker-push

View File

@ -3,14 +3,14 @@ package main
import ( import (
"fmt" "fmt"
"github.com/coreos/poke/connector" "github.com/coreos/dex/connector"
"github.com/coreos/poke/connector/github" "github.com/coreos/dex/connector/github"
"github.com/coreos/poke/connector/ldap" "github.com/coreos/dex/connector/ldap"
"github.com/coreos/poke/connector/mock" "github.com/coreos/dex/connector/mock"
"github.com/coreos/poke/connector/oidc" "github.com/coreos/dex/connector/oidc"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
"github.com/coreos/poke/storage/kubernetes" "github.com/coreos/dex/storage/kubernetes"
"github.com/coreos/poke/storage/memory" "github.com/coreos/dex/storage/memory"
) )
// Config is the config format for the main application. // Config is the config format for the main application.

View File

@ -3,7 +3,7 @@ package main
import ( import (
"testing" "testing"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
"github.com/kylelemons/godebug/pretty" "github.com/kylelemons/godebug/pretty"
yaml "gopkg.in/yaml.v2" yaml "gopkg.in/yaml.v2"

View File

@ -9,7 +9,7 @@ import (
func commandRoot() *cobra.Command { func commandRoot() *cobra.Command {
rootCmd := &cobra.Command{ rootCmd := &cobra.Command{
Use: "poke", Use: "dex",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
cmd.Help() cmd.Help()
os.Exit(2) os.Exit(2)

View File

@ -10,8 +10,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
yaml "gopkg.in/yaml.v2" yaml "gopkg.in/yaml.v2"
"github.com/coreos/poke/server" "github.com/coreos/dex/server"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
func commandServe() *cobra.Command { func commandServe() *cobra.Command {
@ -19,7 +19,7 @@ func commandServe() *cobra.Command {
Use: "serve [ config file ]", Use: "serve [ config file ]",
Short: "Connect to the storage and begin serving requests.", Short: "Connect to the storage and begin serving requests.",
Long: ``, Long: ``,
Example: "poke serve c.yaml", Example: "dex serve c.yaml",
RunE: serve, RunE: serve,
} }
} }

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"runtime" "runtime"
"github.com/coreos/poke/version" "github.com/coreos/dex/version"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -13,7 +13,7 @@ import (
"golang.org/x/oauth2" "golang.org/x/oauth2"
"golang.org/x/oauth2/github" "golang.org/x/oauth2/github"
"github.com/coreos/poke/connector" "github.com/coreos/dex/connector"
) )
const baseURL = "https://api.github.com" const baseURL = "https://api.github.com"

View File

@ -7,7 +7,7 @@ import (
"gopkg.in/ldap.v2" "gopkg.in/ldap.v2"
"github.com/coreos/poke/connector" "github.com/coreos/dex/connector"
) )
// Config holds the configuration parameters for the LDAP connector. // Config holds the configuration parameters for the LDAP connector.

View File

@ -8,7 +8,7 @@ import (
"net/http" "net/http"
"net/url" "net/url"
"github.com/coreos/poke/connector" "github.com/coreos/dex/connector"
) )
// New returns a mock connector which requires no user interaction. It always returns // New returns a mock connector which requires no user interaction. It always returns

View File

@ -11,7 +11,7 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"github.com/coreos/poke/connector" "github.com/coreos/dex/connector"
) )
// Config holds configuration options for OpenID Connect logins. // Config holds configuration options for OpenID Connect logins.

View File

@ -12,10 +12,10 @@ spec:
app: dex app: dex
spec: spec:
containers: containers:
- image: quay.io/ericchiang/poke - image: quay.io/ericchiang/dex
name: dex name: dex
command: command:
- "/poke" - "/dex"
- "serve" - "serve"
- "/dex/config.yaml" - "/dex/config.yaml"
env: env:

View File

@ -1,7 +1,7 @@
# NOTE(ericchiang): Create a separate block for each dependency so it's clear # NOTE(ericchiang): Create a separate block for each dependency so it's clear
# which dependencies require which transitive dependencies. # which dependencies require which transitive dependencies.
package: github.com/coreos/poke package: github.com/coreos/dex
import: import:
- package: github.com/spf13/cobra - package: github.com/spf13/cobra

View File

@ -15,8 +15,8 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
jose "gopkg.in/square/go-jose.v2" jose "gopkg.in/square/go-jose.v2"
"github.com/coreos/poke/connector" "github.com/coreos/dex/connector"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
func (s *Server) handlePublicKeys(w http.ResponseWriter, r *http.Request) { func (s *Server) handlePublicKeys(w http.ResponseWriter, r *http.Request) {

View File

@ -10,7 +10,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
// TODO(ericchiang): clean this file up and figure out more idiomatic error handling. // TODO(ericchiang): clean this file up and figure out more idiomatic error handling.

View File

@ -13,7 +13,7 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
"gopkg.in/square/go-jose.v2" "gopkg.in/square/go-jose.v2"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
// rotationStrategy describes a strategy for generating cryptographic keys, how // rotationStrategy describes a strategy for generating cryptographic keys, how

View File

@ -11,8 +11,8 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/coreos/poke/connector" "github.com/coreos/dex/connector"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
// Connector is a connector with metadata. // Connector is a connector with metadata.

View File

@ -14,9 +14,9 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"github.com/coreos/poke/connector/mock" "github.com/coreos/dex/connector/mock"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
"github.com/coreos/poke/storage/memory" "github.com/coreos/dex/storage/memory"
) )
func mustLoad(s string) *rsa.PrivateKey { func mustLoad(s string) *rsa.PrivateKey {

View File

@ -5,7 +5,7 @@ import (
"net/http" "net/http"
"text/template" "text/template"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
type connectorInfo struct { type connectorInfo struct {

View File

@ -22,8 +22,8 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
yaml "gopkg.in/yaml.v2" yaml "gopkg.in/yaml.v2"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
"github.com/coreos/poke/storage/kubernetes/k8sapi" "github.com/coreos/dex/storage/kubernetes/k8sapi"
) )
type client struct { type client struct {

View File

@ -4,7 +4,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
func muster(t *testing.T) func(err error) { func muster(t *testing.T) func(err error) {

View File

@ -10,8 +10,8 @@ import (
homedir "github.com/mitchellh/go-homedir" homedir "github.com/mitchellh/go-homedir"
"golang.org/x/net/context" "golang.org/x/net/context"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
"github.com/coreos/poke/storage/kubernetes/k8sapi" "github.com/coreos/dex/storage/kubernetes/k8sapi"
) )
const ( const (

View File

@ -4,7 +4,7 @@ import (
"os" "os"
"testing" "testing"
"github.com/coreos/poke/storage/storagetest" "github.com/coreos/dex/storage/storagetest"
) )
func TestLoadClient(t *testing.T) { func TestLoadClient(t *testing.T) {

View File

@ -5,8 +5,8 @@ import (
jose "gopkg.in/square/go-jose.v2" jose "gopkg.in/square/go-jose.v2"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
"github.com/coreos/poke/storage/kubernetes/k8sapi" "github.com/coreos/dex/storage/kubernetes/k8sapi"
) )
// There will only ever be a single keys resource. Maintain this by setting a // There will only ever be a single keys resource. Maintain this by setting a

View File

@ -5,7 +5,7 @@ import (
"errors" "errors"
"sync" "sync"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
// New returns an in memory storage. // New returns an in memory storage.

View File

@ -3,7 +3,7 @@ package memory
import ( import (
"testing" "testing"
"github.com/coreos/poke/storage/storagetest" "github.com/coreos/dex/storage/storagetest"
) )
func TestStorage(t *testing.T) { func TestStorage(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
func TestStaticClients(t *testing.T) { func TestStaticClients(t *testing.T) {

View File

@ -8,7 +8,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/coreos/poke/storage" "github.com/coreos/dex/storage"
) )
var neverExpire = time.Now().Add(time.Hour * 24 * 365 * 100) var neverExpire = time.Now().Add(time.Hour * 24 * 365 * 100)