Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require scheme on userAccessibleOauthIssuerHost #8273

Merged
merged 4 commits into from
Oct 13, 2022

Conversation

seslattery
Copy link
Contributor

@seslattery seslattery commented Oct 12, 2022

Setting oidc.issuerURI: "http://pachd:30658/dex" but wanting a userAccessibleOauthIssuerHost with a scheme of https is currently incompatible, as pachctl auth login -b would use the scheme from the oidc.issuerURI. This is a breaking config change, where we now require a scheme to be explicitly set when configuring userAccessibleOauthIssuerHost, and a guard clause has been added to try and prevent that misconfiguration.

@acohen4
Copy link
Contributor

acohen4 commented Oct 12, 2022

could you update the comment on the proto and regenerate it? https://github.com/pachyderm/pachyderm/blob/master/src/auth/auth.proto#L70

Copy link
Contributor

@BOsterbuhr BOsterbuhr left a comment

Choose a reason for hiding this comment

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

Curious if we can avoid a breaking change.

@seslattery
Copy link
Contributor Author

Ok I pushed up a change making it explicitly non-breaking. PTAL

Copy link
Member

@jrockway jrockway left a comment

Choose a reason for hiding this comment

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

Looks good.

{{- else if (include "pachyderm.host" .) -}}
{{- (include "pachyderm.host" .) -}}
{{- printf "%s://%s" (include "pachyderm.hostproto" .) (include "pachyderm.host" .) -}}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you should use this necessarily, but there is actually a URL building function built into helm: https://helm.sh/docs/chart_template_guide/function_list/#urljoin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, going to leave it this way now for consistency, but might make sense to switch how we construct must url's to that in a followup PR.

@jrockway
Copy link
Member

BTW @BOsterbuhr @seslattery just to be ultra up front about this, it's still potentially a breaking change for people that supply their own auth secret (pachyderm-auth). I'm not sure what the semantics would look like if we accounted for that; on the one hand, generating a manifest with our chart and then expecting it to work forever is the wrong outlook, but on the other hand, people do do it. That said, the one customer I've seen doing this does have a valid URL there, and like I said, I'm not sure what we would do without a scheme on that URL anyway. Assume HTTP?

@seslattery
Copy link
Contributor Author

seslattery commented Oct 12, 2022

BTW @BOsterbuhr @seslattery just to be ultra up front about this, it's still potentially a breaking change for people that supply their own auth secret (pachyderm-auth). I'm not sure what the semantics would look like if we accounted for that; on the one hand, generating a manifest with our chart and then expecting it to work forever is the wrong outlook, but on the other hand, people do do it. That said, the one customer I've seen doing this does have a valid URL there, and like I said, I'm not sure what we would do without a scheme on that URL anyway. Assume HTTP?

Ah good callout on auth-secret. I mean I could assume http, but even then it's still a potentially breaking change in the chance they actually wanted https. I guess I could fallback to the old behavior and look at the issuerURI scheme? But I really don't know that it's worth adding so many layers of logic indirection to try and prevent breakages, as I think it becomes much harder to support in the future. Though we could support the old behavior here, and log.Warn an explicit message that field will require an explicit scheme set in 2.4.0+?

@tybritten @BOsterbuhr thoughts?

Copy link
Contributor

@tybritten tybritten left a comment

Choose a reason for hiding this comment

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

I think its fine. I don't think many customers are using the secret directly.

@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Merging #8273 (9c1b909) into master (3b93ef4) will decrease coverage by 0.55%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #8273      +/-   ##
==========================================
- Coverage    9.00%    8.45%   -0.56%     
==========================================
  Files         352      348       -4     
  Lines      104826   104066     -760     
==========================================
- Hits         9435     8794     -641     
+ Misses      93704    93696       -8     
+ Partials     1687     1576     -111     
Impacted Files Coverage Δ
src/auth/auth.pb.go 14.62% <ø> (+0.12%) ⬆️
src/server/auth/server/oidc.go 46.50% <0.00%> (-0.95%) ⬇️
src/internal/dockertestenv/minio.go 0.00% <0.00%> (-100.00%) ⬇️
src/internal/storage/renew/renewer.go 0.00% <0.00%> (-91.90%) ⬇️
src/internal/miscutil/work_deduper.go 0.00% <0.00%> (-90.00%) ⬇️
src/internal/storage/fileset/renewer.go 0.00% <0.00%> (-76.93%) ⬇️
src/internal/storage/fileset/compaction.go 0.00% <0.00%> (-56.92%) ⬇️
src/internal/storage/kv/memcache.go 14.28% <0.00%> (-54.29%) ⬇️
src/internal/miscutil/log.go 0.00% <0.00%> (-50.00%) ⬇️
src/internal/storage/renew/string_set.go 0.00% <0.00%> (-50.00%) ⬇️
... and 56 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

None yet

5 participants