Skip to content

Conversation

@graingert
Copy link
Contributor

@graingert graingert commented Aug 26, 2016

This change is Reviewable

@graingert
Copy link
Contributor Author

graingert commented Aug 26, 2016

I think this is the minimum change to support HTTP basic auth: You set token_name to "Authorization" and you set token to 'Basic ' + base64.b64encode('%s:%s' % (urllib.quote(username), urllib.quote(password)))

I want basic auth support because its difficult (read without compiling modules) to configure nginx to compare a token securely.

The config:

        location /static/source-maps/ {
          set $auth_realm Restricted;
          if ($http_x_sentry_token = 'redacted') {
            set $auth_realm off;
          }
          auth_basic $auth_realm;
          auth_basic_user_file /etc/nginx/.htpasswd;

          expires max;
          add_header Cache-Control "private";
        }

Isn't secure because the token can be discovered using a timing attack, however basic_auth does hashing (therefore secure compare), salts and multiple access lists etc etc and is generally really handy for this sort of thing.

@graingert graingert force-pushed the support-custom-header-name-for-source-maps branch from 499baa9 to 07202df Compare August 26, 2016 11:19
@graingert graingert force-pushed the support-custom-header-name-for-source-maps branch from 07202df to e92868e Compare August 26, 2016 11:21
@mattrobenolt
Copy link
Contributor

Hey @graingert, I'm ok with this change. Sorry for the delay. I'm going to pull this and test it manually to make sure everything is correct against current master.

@mattrobenolt
Copy link
Contributor

@graingert I'm closing this in favor of #4630 since it needed a few things to make it fully work. :)

mattrobenolt added a commit that referenced this pull request Dec 3, 2016
mattrobenolt added a commit that referenced this pull request Jan 6, 2017
mattrobenolt added a commit that referenced this pull request Jan 6, 2017
* support custom header name for source maps

* Carrying GH-4017
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants