Skip to content

Allow Jenkins email to be set using private email #47

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

Merged
merged 1 commit into from
Jul 24, 2015

Conversation

samrocketman
Copy link
Member

Update default OAuth scope to read:org,user:email. This allows the Jenkins profile email to be set to the private primary GitHub email.

user:email scope is optional. If an admin wishes to further restrict it they can. It will fall back to attempting to read a public email.

fixes JENKINS-27764

@samrocketman
Copy link
Member Author

Code review, please. cc @cloudbeesci, @jhoblitt.

@@ -21,7 +21,7 @@
</f:entry>

<f:entry title="OAuth Scope(s)" field="oauthScopes" help="/plugin/github-oauth/help/realm/oauth-scopes-help.html">
<f:textbox default="read:org" />
<f:textbox default="read:org,user:email" />
Copy link
Member

Choose a reason for hiding this comment

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

I'm fairly clueless about jelly<->stapler. Is there a way of calling #defaultOauthScope from the jelly template? That would be a lot better than my kludge of hard coding the default value in two places

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps, let me see if I can hack something together real quick.

@samrocketman
Copy link
Member Author

@jhoblitt updated jelly to include descriptor. Here's how I went about figuring it out.

  1. Google jenkins plugins config.jelly.
  2. Found high level example in wiki.
  3. Google jenkins plugin descriptor.defaultHost to try to find an example implementation.
  4. Found implemented config.jelly and it's matching class.
  5. Profit.

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@samrocketman
Copy link
Member Author

I uploaded a new change. It uses a hasScope() function instead.

@samrocketman samrocketman modified the milestone: github-oauth-0.22 Jul 21, 2015
@samrocketman samrocketman force-pushed the use_primary_email branch 3 times, most recently from 7d93d84 to 642f8c1 Compare July 24, 2015 00:48
Update default OAuth scope to read:org,user:email.  This allows the
Jenkins profile email to be set to the private primary GitHub email.

user:email scope is optional.  If an admin wishes to further restrict
it they can.  It will fall back to attempting to read a public email.

fixes [JENKINS-27764]
@samrocketman samrocketman merged commit 4aff786 into master Jul 24, 2015
samrocketman added a commit that referenced this pull request Jul 24, 2015
@samrocketman samrocketman deleted the use_primary_email branch July 24, 2015 01:14
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.

3 participants