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 JENKINS-28010 Use Google Apps group for Authorization #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

juulderuysscher
Copy link

@juulderuysscher juulderuysscher commented Jan 7, 2020

I created an enhancement which makes it possible to fetch the Google Groups for an user via the Google Admin SDK.

https://developers.google.com/admin-sdk/directory/v1/reference/groups/list
https://issues.jenkins-ci.org/browse/JENKINS-28010

@mjagielka
Copy link

Hey. Any news here? Do you have any date when this feature will be released? It will be really useful.

@lucasheringer
Copy link

Any news here?
Do you have any date when this feature will be released?

@jglick
Copy link
Member

jglick commented Aug 5, 2020

Given that #17 remains unmerged I am guessing this plugin is abandoned. (@Vlatombe + @recampbell listed as having push permission)

@@ -326,5 +421,20 @@ public FormValidation doCheckApiSecret(@QueryParameter String clientId, @QueryPa
}
*/

@RequirePOST
public ListBoxModel doFillGsuiteServiceAccountCredentialsIdItems(@QueryParameter String serverUrl) {
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
Copy link
Member

Choose a reason for hiding this comment

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

I think this is incorrect.
if the user does not have admin (system read) then they should get a postbox with the current credential?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

If they do not have admin they should not be configuring the security realm to begin with. I see nothing amiss here.

Copy link
Member

@jtnord jtnord Aug 7, 2020

Choose a reason for hiding this comment

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

SYSTEM_READ allows rendering this but not configuring - and if the listbox does not contain the current credential it will be rednered incorrectly IIRC.

https://github.com/jenkinsci/credentials-plugin/blob/master/docs/consumer.adoc#providing-a-ui-form-element-to-let-a-user-select-credentials the first doFillXZ annotated example

Copy link
Member

Choose a reason for hiding this comment

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

If the plugin is using a new core dep, yes. Currently using an obsolete parent POM which does not even declare jenkins.version, so something old.

Copy link
Member

@jtnord jtnord 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 there are som issues around the credential listbox population.
also won't work with system_read access


do {
Groups groupsResult = googleAdminDirectoryService.groups().list()
.setUserKey(email)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't pageToken be used in this request?

Copy link
Author

Choose a reason for hiding this comment

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

Indeed .setPageToken(pageToken) should be used here. When the user has 200+ groups it will fail badly now.

@oleg-filiutsich
Copy link

Then the feature will release?

@mayeco
Copy link

mayeco commented Aug 17, 2021

ping

@oleg-filiutsich
Copy link

7c4550418bb7cf

@never00rei
Copy link

Ping!!

@mayeco
Copy link

mayeco commented Oct 15, 2021

this is why cloudbees / jenkins is dying.

@julien-deruere
Copy link

julien-deruere commented Oct 15, 2021

I switched to github login instead, it works with github team perfectly.
If you can, do it!

@mayerro
Copy link

mayerro commented Oct 27, 2021

Ping!

@jglick
Copy link
Member

jglick commented Oct 29, 2021

Please do not add ping-type comments to issues. https://www.jenkins.io/doc/developer/plugin-governance/adopt-a-plugin/ if you want to do something about it.

@antgel
Copy link

antgel commented Oct 30, 2021

@jglick Obviously you're right, obnoxious behaviour from people who don't understand nor care how open source works, nor do they care about everyone getting pinged every time they feel they have to add their useless comment when a thumbs-up on the original would presumably have done (I hope so anyway).

However, there is actually some code here, and nothing is happening. The link you sent includes the following:

Adopting abandoned plugins. Sometimes plugin maintainers move on without marking plugins for adoption, due to various reasons. In such case we can transfer ownership for plugins being hosted within the jenkinsci GitHub organization. Such transfer may take a while.

This plugin is already hosted within the jenkinsci GitHub organization. So now what? How do we even know who the maintainers are? What can the community expect from plugins hosted in the jenkinsci org?

@never00rei
Copy link

never00rei commented Oct 30, 2021 via email

@antgel
Copy link

antgel commented Oct 30, 2021

I think the point is that the useless comments are not the way to make progress.

@jglick
Copy link
Member

jglick commented Nov 1, 2021

How do we even know who the maintainers are?

You can look it up: https://github.com/jenkins-infra/repository-permissions-updater/blob/ba97350a9a74756f5e5f23780b40f146d1952647/permissions/plugin-google-login.yml#L8-L10 and if you want something shipped but a maintainer is not responsive, the page on jenkins.io documents how to propose taking over maintainership of the plugin (either with immediate approval from the old maintainer, or failing that, a two-week grace period IIRC).

In this case there actually is a maintainer review (#18 (comment)) which was never addressed. So if you care to move things along, best to file a subsuming PR which addresses any open review issues, or explain why they are misplaced.

@antgel
Copy link

antgel commented Nov 2, 2021

Thanks @jglick , for me at least the comment got lost in the noise. @juulderuysscher Are you willing and able to address the comment? @Vlatombe I see you're active with the thumbs up, can you maybe elaborate on the comment for those of us who are new to Jenkins dev but would be happy to help out? Is the idea that there may be a lot of groups hence pagination is necessary?

@Vlatombe
Copy link
Member

Vlatombe commented Nov 2, 2021

Is the idea that there may be a lot of groups hence pagination is necessary?

Yes exactly. Unfortunately I don't have a setup with google that would allow me to validate this change, but as it is, it is clear that pagination wouldn't work so the change isn't correct.

@antgel
Copy link

antgel commented Nov 2, 2021

@Vlatombe Thanks! I'll see if we can take a look at that code and polish it, although we are new to Jenkins dev. For the avoidance of doubt, you're active and consider the plugin maintained?

@juulderuysscher
Copy link
Author

juulderuysscher commented Nov 2, 2021

Is the idea that there may be a lot of groups hence pagination is necessary?

Yes exactly. Unfortunately I don't have a setup with google that would allow me to validate this change, but as it is, it is clear that pagination wouldn't work so the change isn't correct.

Currently I don't have time to validate and test an improvement to this PR myself. pageToken should be fixed before merging this indeed.

Regarding the remarks on the Jenkins specific config at the time when I needed this it worked for me. However not sure how this can be improved? I'm not familiar with Jenkins internal APIs.

@antgel
Copy link

antgel commented Nov 3, 2021

I've cloned the source so I can try to test and submit the pagination fix. The problem is that in order to test it, I run mvn hpi:run in accordance with the docs. This starts a local Jenkins at http://localhost:8080/jenkins/. However as expected, when I configure the credentials for the Google Login plugin, it complains because my URL isn't HTTPS. What's the sanest development flow? Build with mvn hpi:hpi and manually install on a Jenkins in the cloud that has HTTPS configured?

Scrap that, it works!

@ArtemChekunov
Copy link

any chance to get it merged?

@antgel
Copy link

antgel commented Mar 16, 2022

@ArtemChekunov When I said "it works", I meant that I got the local Jenkins dev environment up and running. Sadly I haven't gotten further than that. Perhaps in coming weeks we may have time, but don't wait for me...

@eugen-korentsov
Copy link

image

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.