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

Implement Public Clients #471

Merged
merged 11 commits into from
Jun 21, 2016
Merged

Implement Public Clients #471

merged 11 commits into from
Jun 21, 2016

Conversation

bobbyrullo
Copy link
Contributor

fixes #469


err := cli.Metadata.Valid()
if err != nil {
fmt.Println("manager throwing validation error")
Copy link
Contributor

Choose a reason for hiding this comment

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

left over log statement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WIP Means work in progress :)

@bobbyrullo bobbyrullo force-pushed the native branch 2 times, most recently from 304bf66 to 89280b1 Compare June 20, 2016 18:26
@bobbyrullo bobbyrullo force-pushed the native branch 2 times, most recently from bdbf96c to cb207e7 Compare June 20, 2016 19:58
@bobbyrullo bobbyrullo changed the title Implement Public Clients (WIP!!!) Implement Public Clients Jun 20, 2016
@ericchiang
Copy link
Contributor

Got a vet error

Checking govet...
gopath/src/github.com/coreos/dex/client/manager/manager.go:237: github.com/coreos/dex/client.ValidationError composite literal uses unkeyed fields


err := cli.Metadata.Valid()
if err != nil {
return client.ValidationError{err}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the vet error btw. Needs to be client.ValidationError{Err:err}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I just don't know why mine didn't catch it.

@@ -165,6 +163,12 @@ func (a *AdminAPI) GetConnectors() ([]connector.ConnectorConfig, error) {
}

func mapError(e error) error {
switch t := e.(type) {
case client.ValidationError:
Copy link
Contributor

Choose a reason for hiding this comment

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

I really dislike type switching for a specific error since it makes the validateClient code really brittle. Would be nice if this was formalized more, such as introducing HTTP specific error behavior. I suppose that's outside of the scope of this PR though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would it help if I documented manager.New() as to which errors can be returned?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe put it on ValidationError? Whichever works best. If it's tested that might be enough.

Bobby Rullo added 10 commits June 20, 2016 17:03
* validation of client moved into its own method and tested
* public clients have different validation - must have no redirect URIs
  and must have a clientName set
  * Start Documentation
Metadata is not enough these days - we're going to need access to the
Public field as well.
* disallow ClientCreds for public clients
* clients can only redirect to localhost or OOB
When calling manager.Authenticate, logs now show different error
messages.
When "urn:ietf:wg:oauth:2.0:oob" is used as a redirect URI, redirect to
an internal dex page where the user is shown the code and instructed to
paste it into their app.
@bobbyrullo bobbyrullo merged commit 3b8d704 into dexidp:master Jun 21, 2016
@HEllRZA HEllRZA mentioned this pull request Sep 17, 2020
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.

Public Clients
2 participants