Skip to content

Commit

Permalink
feat: upgrade dex to v2.23.0 (argoproj#3448)
Browse files Browse the repository at this point in the history
* feat: upgrade dex to v2.23.0

* workaround for dexidp/dex#1695
  • Loading branch information
Alexander Matyushentsev authored Apr 21, 2020
1 parent 9de06e3 commit acc2369
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
controller: sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true go run ./cmd/argocd-application-controller/main.go --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081}"
api-server: sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true go run ./cmd/argocd-server/main.go --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --disable-auth=${ARGOCD_E2E_DISABLE_AUTH:-'true'} --insecure --dex-server http://localhost:${ARGOCD_E2E_DEX_PORT:-5556} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081} --port ${ARGOCD_E2E_APISERVER_PORT:-8080} --staticassets ui/dist/app"
dex: sh -c "go run github.com/argoproj/argo-cd/cmd/argocd-util gendexcfg -o `pwd`/dist/dex.yaml && docker run --rm -p ${ARGOCD_E2E_DEX_PORT:-5556}:${ARGOCD_E2E_DEX_PORT:-5556} -v `pwd`/dist/dex.yaml:/dex.yaml quay.io/dexidp/dex:v2.21.0 serve /dex.yaml"
dex: sh -c "go run github.com/argoproj/argo-cd/cmd/argocd-util gendexcfg -o `pwd`/dist/dex.yaml && docker run --rm -p ${ARGOCD_E2E_DEX_PORT:-5556}:${ARGOCD_E2E_DEX_PORT:-5556} -v `pwd`/dist/dex.yaml:/dex.yaml quay.io/dexidp/dex:v2.23.0 serve /dex.yaml"
redis: docker run --rm --name argocd-redis -i -p ${ARGOCD_E2E_REDIS_PORT:-6379}:${ARGOCD_E2E_REDIS_PORT:-6379} redis:5.0.3-alpine --save "" --appendonly no --port ${ARGOCD_E2E_REDIS_PORT:-6379}
repo-server: sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true go run ./cmd/argocd-repo-server/main.go --loglevel debug --port ${ARGOCD_E2E_REPOSERVER_PORT:-8081} --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379}"
ui: sh -c 'cd ui && ${ARGOCD_E2E_YARN_CMD:-yarn} start'
Expand Down
2 changes: 2 additions & 0 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ const (
ArgoCDCLIClientAppName = "Argo CD CLI"
// ArgoCDCLIClientAppID is the Oauth client ID we will use when registering our CLI to dex
ArgoCDCLIClientAppID = "argo-cd-cli"
// Workaround for https://github.com/dexidp/dex/issues/1695. Should be removed when bug is fixed.
ArgoCDCLISecret = "dummy-secret"
)

// Resource metadata labels and annotations (keys and values) used by Argo CD components
Expand Down
2 changes: 1 addition & 1 deletion manifests/base/dex/argocd-dex-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
name: static-files
containers:
- name: dex
image: quay.io/dexidp/dex:v2.21.0
image: quay.io/dexidp/dex:v2.23.0
imagePullPolicy: Always
command: [/shared/argocd-util, rundex]
ports:
Expand Down
2 changes: 1 addition & 1 deletion manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2909,7 +2909,7 @@ spec:
- command:
- /shared/argocd-util
- rundex
image: quay.io/dexidp/dex:v2.21.0
image: quay.io/dexidp/dex:v2.23.0
imagePullPolicy: Always
name: dex
ports:
Expand Down
2 changes: 1 addition & 1 deletion manifests/ha/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2824,7 +2824,7 @@ spec:
- command:
- /shared/argocd-util
- rundex
image: quay.io/dexidp/dex:v2.21.0
image: quay.io/dexidp/dex:v2.23.0
imagePullPolicy: Always
name: dex
ports:
Expand Down
2 changes: 1 addition & 1 deletion manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2409,7 +2409,7 @@ spec:
- command:
- /shared/argocd-util
- rundex
image: quay.io/dexidp/dex:v2.21.0
image: quay.io/dexidp/dex:v2.23.0
imagePullPolicy: Always
name: dex
ports:
Expand Down
2 changes: 1 addition & 1 deletion manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,7 @@ spec:
- command:
- /shared/argocd-util
- rundex
image: quay.io/dexidp/dex:v2.21.0
image: quay.io/dexidp/dex:v2.23.0
imagePullPolicy: Always
name: dex
ports:
Expand Down
9 changes: 6 additions & 3 deletions pkg/apiclient/apiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ func (c *client) OIDCConfig(ctx context.Context, set *settingspkg.Settings) (*oa
var clientID string
var issuerURL string
var scopes []string
clientSecret := ""
if set.OIDCConfig != nil && set.OIDCConfig.Issuer != "" {
if set.OIDCConfig.CLIClientID != "" {
clientID = set.OIDCConfig.CLIClientID
Expand All @@ -226,6 +227,7 @@ func (c *client) OIDCConfig(ctx context.Context, set *settingspkg.Settings) (*oa
scopes = set.OIDCConfig.Scopes
} else if set.DexConfig != nil && len(set.DexConfig.Connectors) > 0 {
clientID = common.ArgoCDCLIClientAppID
clientSecret = common.ArgoCDCLISecret
issuerURL = fmt.Sprintf("%s%s", set.URL, common.DexAPIEndpoint)
} else {
return nil, nil, fmt.Errorf("%s is not configured with SSO", c.ServerAddr)
Expand All @@ -243,9 +245,10 @@ func (c *client) OIDCConfig(ctx context.Context, set *settingspkg.Settings) (*oa
scopes = append(scopes, oidc.ScopeOfflineAccess)
}
oauth2conf := oauth2.Config{
ClientID: clientID,
Scopes: scopes,
Endpoint: provider.Endpoint(),
ClientID: clientID,
ClientSecret: clientSecret,
Scopes: scopes,
Endpoint: provider.Endpoint(),
}
return &oauth2conf, provider, nil
}
Expand Down
2 changes: 1 addition & 1 deletion test/container/Procfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
controller: su --pty -m default -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true go run ./cmd/argocd-application-controller/main.go --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081}"
api-server: su --pty -m default -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true go run ./cmd/argocd-server/main.go --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --disable-auth=${ARGOCD_E2E_DISABLE_AUTH:-'true'} --insecure --dex-server http://localhost:${ARGOCD_E2E_DEX_PORT:-5556} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081} --port ${ARGOCD_E2E_APISERVER_PORT:-8080} --staticassets ui/dist/app"
dex: su --pty -m default -c "test \"$ARGOCD_IN_CI\" = \"true\" && exit 0; go run github.com/argoproj/argo-cd/cmd/argocd-util gendexcfg -o `pwd`/dist/dex.yaml && docker run --rm -p ${ARGOCD_E2E_DEX_PORT:-5556}:${ARGOCD_E2E_DEX_PORT:-5556} -v `pwd`/dist/dex.yaml:/dex.yaml quay.io/dexidp/dex:v2.21.0 serve /dex.yaml"
dex: su --pty -m default -c "test \"$ARGOCD_IN_CI\" = \"true\" && exit 0; go run github.com/argoproj/argo-cd/cmd/argocd-util gendexcfg -o `pwd`/dist/dex.yaml && docker run --rm -p ${ARGOCD_E2E_DEX_PORT:-5556}:${ARGOCD_E2E_DEX_PORT:-5556} -v `pwd`/dist/dex.yaml:/dex.yaml quay.io/dexidp/dex:v2.23.0 serve /dex.yaml"
redis: su --pty -m default -c "/usr/local/bin/redis-server --save "" --appendonly no --port ${ARGOCD_E2E_REDIS_PORT:-6379}"
repo-server: su --pty -m default -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true go run ./cmd/argocd-repo-server/main.go --loglevel debug --port ${ARGOCD_E2E_REPOSERVER_PORT:-8081} --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379}"
ui: su --pty -m default -c "test \"$ARGOCD_IN_CI\" = \"true\" && exit 0; cd ui && ARGOCD_E2E_YARN_HOST=0.0.0.0 ${ARGOCD_E2E_YARN_CMD:-yarn} start"
Expand Down
1 change: 1 addition & 0 deletions util/dex/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func GenerateDexConfigYAML(settings *settings.ArgoCDSettings) ([]byte, error) {
{
"id": common.ArgoCDCLIClientAppID,
"name": common.ArgoCDCLIClientAppName,
"secret": common.ArgoCDCLISecret,
"public": true,
"redirectURIs": []string{
"http://localhost",
Expand Down

0 comments on commit acc2369

Please sign in to comment.