Skip to content

Commit f557612

Browse files
authored
Merge branch 'kubecon-2025' into feat/finops-open-api-v1
2 parents a67f9d4 + dd90dae commit f557612

File tree

33 files changed

+1390
-293
lines changed

33 files changed

+1390
-293
lines changed

authenticator/client/oidcClient.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,42 @@ func GetSettings(conf *DexConfig) (*oidc.Settings, error) {
4141
if err != nil {
4242
return nil, err
4343
}
44+
4445
settings := &oidc.Settings{
4546
URL: conf.Url,
4647
OIDCConfig: oidc.OIDCConfig{CLIClientID: conf.DexClientID,
4748
ClientSecret: conf.DexClientSecret,
4849
Issuer: proxyUrl,
4950
ServerSecret: conf.ServerSecret,
50-
RequestedScopes: conf.DexScopes,
51+
RequestedScopes: conf.GetDexScopes(),
5152
},
5253
UserSessionDuration: time.Duration(conf.UserSessionDurationSeconds) * time.Second,
5354
AdminPasswordMtime: conf.AdminPasswordMtime,
5455
}
5556
return settings, nil
5657
}
58+
func (conf *DexConfig) GetDexScopes() []string {
59+
// passing empty array to get default scopes
60+
defaultScopes := oidc.GetScopesOrDefault([]string{})
61+
additionalScopes := conf.DexScopes
62+
63+
occurrenceMap := make(map[string]bool)
64+
finalScopes := make([]string, 0, len(defaultScopes)+len(additionalScopes))
65+
66+
// first add all the default
67+
for _, scope := range defaultScopes {
68+
occurrenceMap[scope] = true
69+
finalScopes = append(finalScopes, scope)
70+
}
71+
// append extra configs
72+
for _, scope := range additionalScopes {
73+
if _, exists := occurrenceMap[scope]; !exists {
74+
occurrenceMap[scope] = true
75+
finalScopes = append(finalScopes, scope)
76+
}
77+
}
78+
return finalScopes
79+
}
5780
func getOidcClient(dexServerAddress string, settings *oidc.Settings, userVerifier oidc.UserVerifier, RedirectUrlSanitiser oidc.RedirectUrlSanitiser) (*oidc.ClientApp, func(writer http.ResponseWriter, request *http.Request), error) {
5881
dexClient := &http.Client{
5982
Transport: &http.Transport{

chart-sync/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.0
44

55
toolchain go1.24.3
66

7-
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a
7+
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3
88

99
require (
1010
github.com/caarlos0/env v3.5.0+incompatible

chart-sync/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
4343
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4444
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
4545
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
46-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a h1:4IenPb4m+9xPCrJnTSz2IsauB1mdwu7K5ReqDDhEV6Y=
47-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
46+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3 h1:jCxpB8+6KD29jenB4SLTimCYzsmazBAPKv6637xRT5M=
47+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
4848
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
4949
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
5050
github.com/distribution/distribution/v3 v3.0.0 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM=

chart-sync/vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ github.com/containerd/platforms
9595
# github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
9696
## explicit
9797
github.com/davecgh/go-spew/spew
98-
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a
98+
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3
9999
## explicit; go 1.24.0
100100
github.com/devtron-labs/common-lib/constants
101101
github.com/devtron-labs/common-lib/fetchAllEnv
@@ -967,4 +967,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
967967
sigs.k8s.io/yaml
968968
sigs.k8s.io/yaml/goyaml.v2
969969
sigs.k8s.io/yaml/goyaml.v3
970-
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a
970+
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3

ci-runner/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.0
44

55
toolchain go1.24.3
66

7-
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a
7+
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3
88

99
require (
1010
github.com/Knetic/govaluate v3.0.0+incompatible

ci-runner/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
114114
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
115115
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
116116
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
117-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a h1:4IenPb4m+9xPCrJnTSz2IsauB1mdwu7K5ReqDDhEV6Y=
118-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
117+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3 h1:jCxpB8+6KD29jenB4SLTimCYzsmazBAPKv6637xRT5M=
118+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
119119
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
120120
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
121121
github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k=

ci-runner/vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ github.com/cncf/xds/go/xds/type/v3
298298
# github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
299299
## explicit
300300
github.com/davecgh/go-spew/spew
301-
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a
301+
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3
302302
## explicit; go 1.24.0
303303
github.com/devtron-labs/common-lib/blob-storage
304304
github.com/devtron-labs/common-lib/constants
@@ -1198,4 +1198,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
11981198
## explicit; go 1.12
11991199
sigs.k8s.io/yaml
12001200
sigs.k8s.io/yaml/goyaml.v2
1201-
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250806091511-49f0b9d1654a
1201+
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250901093002-1be330be4db3

0 commit comments

Comments
 (0)