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

Openidc #188

Merged
merged 1 commit into from
Feb 16, 2017
Merged

Openidc #188

merged 1 commit into from
Feb 16, 2017

Conversation

puiterwijk
Copy link
Contributor

No description provided.

data={'client_id': self.client_id,
'client_secret': self.client_secret,
'token': token['access_token']})
# TODO: Be a bit more stable in handling if we get a non-JSON object
Copy link
Member

@jeremycline jeremycline Dec 22, 2016

Choose a reason for hiding this comment

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

I know this is a work-in-progress that you haven't tested and kindly opened for me, but here's some drive-by feedback ✈️

I'd recommend doing something like

# Throw an HTTPError-based exception for a HTTP 400+ code
resp.raise_for_status()
try:
    return resp.json()
except JSONDecodeError:
   raise SomeExceptionThatTellsUsersTheServerShouldHaveGivenUsJSON

Copy link
Contributor

Choose a reason for hiding this comment

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

I like @jeremycline's suggestion 👍

@ralphbean
Copy link
Contributor

Just FYI, module-build-service is blocking on this PR over here: https://pagure.io/fm-orchestrator/issue/268

@@ -0,0 +1,385 @@
#!/usr/bin/env python2 -tt

Choose a reason for hiding this comment

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

bad idea to have shebangs (especially python2's ;))

testopenidc.py Outdated

inst = OpenIDCBaseClient('http://myapp.com', 'myapp', id_provider='http://172.17.0.2:8080/openidc/')

print inst.get_token(['ipsilon'], False)

Choose a reason for hiding this comment

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

shouldn't it be print functions?


# Just return a message
out = StringIO()
print >>out, "You can close this window and return to the CLI"

Choose a reason for hiding this comment

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

py2.. meh

Copy link

@ignatenkobrain ignatenkobrain left a comment

Choose a reason for hiding this comment

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

too much py2-only stuff =(

query['redirect_uri'] = return_uri
query['state'] = 'ignored'
query['response_mode'] = 'query'
query = urllib.urlencode(query)

Choose a reason for hiding this comment

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

not gonna work on py3.. it's in urllib.parse there. you can use six.moves to get urllib_parse

@maxamillion
Copy link
Contributor

LGTM 👍

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
@puiterwijk puiterwijk merged commit a804213 into develop Feb 16, 2017
@puiterwijk puiterwijk deleted the openidc branch February 16, 2017 20:53
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.

5 participants