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

[installer]: validate the AuthProvider config value #6753

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

mrsimonemms
Copy link
Contributor

@mrsimonemms mrsimonemms commented Nov 17, 2021

Description

Gets the auth provider config working. Adds the id, host and type params to the AuthProvider and also adds validation on the required fields

Related Issue(s)

Fixes #6750

How to test

Run installer with config:

authProviders:
  - id: Public-GitHub
    host: github.com
    type: GitHub
    oauth:
      clientId: xxx
      clientSecret: xxx
      callBackUrl: https://<URL>/auth/github.com/callback
      settingsUrl: https://github.com/organizations/openapiary/settings/applications/<id>
    description: ""
    icon: ""

Remove one of the ones marked required in there and the validation should fail

Release Notes

[installer]: fix the auth provider config

Documentation

@roboquat roboquat added release-note team: workspace Issue belongs to the Workspace team size/S labels Nov 17, 2021
@codecov
Copy link

codecov bot commented Nov 17, 2021

Codecov Report

Merging #6753 (5038c84) into main (6e565c3) will decrease coverage by 12.87%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #6753       +/-   ##
==========================================
- Coverage   19.04%   6.16%   -12.88%     
==========================================
  Files           2      12       +10     
  Lines         168    1086      +918     
==========================================
+ Hits           32      67       +35     
- Misses        134    1018      +884     
+ Partials        2       1        -1     
Flag Coverage Δ
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?
installer-raw-app 6.16% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/local-app/pkg/auth/auth.go
components/local-app/pkg/auth/pkce.go
...staller/pkg/components/ws-manager/networkpolicy.go 0.00% <0.00%> (ø)
installer/pkg/common/display.go 0.00% <0.00%> (ø)
installer/pkg/common/storage.go 0.00% <0.00%> (ø)
installer/pkg/common/objects.go 0.00% <0.00%> (ø)
installer/pkg/components/ws-manager/role.go 0.00% <0.00%> (ø)
...components/ws-manager/unpriviledged-rolebinding.go 0.00% <0.00%> (ø)
installer/pkg/common/common.go 4.74% <0.00%> (ø)
installer/pkg/common/render.go 0.00% <0.00%> (ø)
... and 4 more

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 6e565c3...5038c84. Read the comment docs.

Copy link
Contributor

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

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

@mrsimonemms just a question Re: conditional validation support in Go - thanks for the heads up! Let me know your preference?

installer/pkg/config/v1/config.go Show resolved Hide resolved
installer/pkg/config/v1/config.go Outdated Show resolved Hide resolved
Adds the id, host and type params to the AuthProvider and also adds validation
on the required fields
@mrsimonemms mrsimonemms force-pushed the sje/install-auth-provider-configs branch from b467bb8 to 5038c84 Compare November 17, 2021 16:51
@mrsimonemms mrsimonemms requested a review from kylos101 November 17, 2021 16:55
Copy link
Contributor

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

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

@mrsimonemms nice work, amigo! Have a good rest of your evening. 🌃

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: bd18bf85faaa29856689d38751997e64be0490bc

@kylos101
Copy link
Contributor

/approve

@kylos101
Copy link
Contributor

/approve no-issue

@mrsimonemms
Copy link
Contributor Author

/approve

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kylos101, MrSimonEmms

Associated issue: #6750

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit 0e6477d into main Nov 17, 2021
@roboquat roboquat deleted the sje/install-auth-provider-configs branch November 17, 2021 17:25
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note size/S team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[installer]: configure AuthProviders settings
3 participants