Skip to content

Conversation

jphelton
Copy link
Contributor

@jphelton jphelton commented Oct 30, 2021

Fixes #7275

Signed-off-by: Joshua Helton jdoghelton@gmail.com

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@jphelton jphelton marked this pull request as ready for review October 30, 2021 18:29
…generated block

Signed-off-by: Joshua Helton <jdoghelton@gmail.com>
Signed-off-by: jphelton <jdoghelton@gmail.com>
}else {
dexCfg["oauth2"] = map[string]interface{}{
"skipApprovalScreen": true,
}
}

Copy link
Contributor

@wtam2018 wtam2018 Oct 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. I would slightly simplify it as follow.

	if oauth2Cfg, found := dexCfg["oauth2"].(map[string]interface{}); found {
		if _, found := oauth2Cfg["skipApprovalScreen"].(bool); !found {
			oauth2Cfg["skipApprovalScreen"] = true
		}
	} else {
		dexCfg["oauth2"] = map[string]interface{}{
			"skipApprovalScreen": true,
		}
	}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the advice. I'm new to Go and not used to variable declaration inside of an if-statement.

Signed-off-by: Joshua Helton <jdoghelton@gmail.com>
@wtam2018 wtam2018 self-requested a review November 1, 2021 03:52
Copy link
Contributor

@wtam2018 wtam2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks @jphelton

@codecov
Copy link

codecov bot commented Nov 1, 2021

Codecov Report

Merging #7583 (5e6b9a1) into master (c779252) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7583      +/-   ##
==========================================
+ Coverage   41.37%   41.39%   +0.02%     
==========================================
  Files         161      161              
  Lines       21680    21684       +4     
==========================================
+ Hits         8970     8976       +6     
+ Misses      11444    11443       -1     
+ Partials     1266     1265       -1     
Impacted Files Coverage Δ
util/dex/config.go 89.01% <100.00%> (+2.80%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c779252...5e6b9a1. Read the comment docs.

@alexmt alexmt merged commit e5c34f4 into argoproj:master Nov 1, 2021
@jphelton jphelton deleted the bugfix/issue7275 branch February 8, 2023 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Argo CD's dex integration overwrites a custom dex.config.oauth2 yaml block
3 participants