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

RFC: Authentication for read only access to Web UI #2524

Closed
wants to merge 2 commits into from

Conversation

bendikro
Copy link
Contributor

@bendikro bendikro commented Dec 3, 2016

This is most definitely not mergeable as is, and is mainly a request for comments.

Authentication for read only access to Web UI

I have tried to figure out how to enforce authentication for accessing the Web UI. The last trace I found of a discussion on this is in these emails which indicate this is not supported yet.

This PR adds a call to assertUserAllowed() in www/config.IndexResource.renderIndex()
which enforces authentication based on the allowRules. However, this changes the behavior of the current code such that AnyEndpointMatcher now matches any access to the Web UI.

According to the docs, the endpoint matchers are only responsible for the REST endpoints, so
I presume a proper solution would add a separate set of allowRules for viewing the different parts of the Web UI?

oauth2.GitHubAuth

https://api.github.com/users/{username}/orgs only returns the organizations for the user that are publicly visible. Is that intended?
This has been changed to `https://api.github.com/user/orgs' which returns all organziations for the user (requires scope=user)

oauth2.BitbucketAuth

Implemented

Contributor Checklist:

  • I have updated the unit tests
  • I have created a file in the master/buildbot/newsfragment directory (and read the README.txt in that directory)
  • I have updated the appropriate documentation

Feedback

Please give feedback on how I can improve this, or even better, make the required changes yourself if you desire.

@mention-bot
Copy link

@bendikro, thanks for your PR! By analyzing the history of the files in this pull request, we identified @djmitche, @tardyp and @pieterlexis to be potential reviewers.

Copy link
Member

@tardyp tardyp left a comment

Choose a reason for hiding this comment

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

Beware this is a false sense of security.

You will effectively prevent access to index page, but not to the REST apis.
REST api is what realy matters in term of security as this is our valuable data. The index.html is opensource and public, no need to restrict that.

Then, in term of UX, I think this is a good thing to allow admin to force user login, with a lightwight login UI before sending the full fledge UI (like you did).

So overall I think this is a good PR.

  • need documentation on how to setup this (with example)
  • Need to put the login template inside buildbot_www module
  • Please separate Bitbucket oauth in another PR.

conf = self.config['auth'].getConfigDict()
conf.update(user_info)
conf["message"] = err
tpl = self.jinja.from_string("""
Copy link
Member

Choose a reason for hiding this comment

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

Oh no! We don't want to hardcode any html here.

We need to get the index template from the buildbot_www module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Certainly, this was only a temporary quick fix.

if isinstance(obj, dict):
return obj
return repr(obj) + " not yet IConfigured"

tpl = self.jinja.get_template('index.html')
Copy link
Member

Choose a reason for hiding this comment

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

This is how the template is found from the main www module

@tardyp
Copy link
Member

tardyp commented Dec 13, 2016

I believe this has be splitted into several PR alread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants