Implement explicit HTTP "basic" authentication support #864

Open
ivanbratovic wants to merge 6 commits from ivanbratovic/http-basicauth into master
ivanbratovic commented 3 years ago (Migrated from github.com)
Owner

Description

Fixes #599, #768, #834.

Users seem to have trouble with configuring HTTP "basic" auth. This PR adds new inputs for HTTP(s) and Keyword monitors to set HTTP "basic" auth username and password. These are encoded in Base64 and added to the headers of the request.

This makes adding endpoints with HTTP "basic" authentication a bit more user-friendly, not requiring manual encoding and adding to the Headers section. However, the old way still works and "basic" auth monitors created before the upgrade should continue working normally.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and test it
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • ~My code needed automated testing. I have added them (this is optional task)~

Screenshots

image

# Description Fixes #599, #768, #834. Users seem to have trouble with configuring HTTP "basic" auth. This PR adds new inputs for HTTP(s) and Keyword monitors to set HTTP "basic" auth username and password. These are encoded in Base64 and added to the headers of the request. This makes adding endpoints with HTTP "basic" authentication a bit more user-friendly, not requiring manual encoding and adding to the Headers section. However, the old way still works and "basic" auth monitors created before the upgrade should continue working normally. ## Type of change - New feature (non-breaking change which adds functionality) ## Checklist - [x] My code follows the style guidelines of this project - [x] I ran ESLint and other linters for modified files - [x] I have performed a self-review of my own code and test it - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - ~My code needed automated testing. I have added them (this is optional task)~ ## Screenshots ![image](https://user-images.githubusercontent.com/28808569/140284236-3d7ef2ff-fce0-48a3-a953-b4348f64a260.png)
Saibamen commented 3 years ago (Migrated from github.com)
Owner

You can add screenshots directly to GitHub. Just paste it to comment field

image

You can add screenshots directly to GitHub. Just paste it to comment field ![image](https://user-images.githubusercontent.com/905878/140027609-6de357d1-72db-4486-8c38-4f36d840252d.png)
Saibamen (Migrated from github.com) reviewed 3 years ago
Saibamen (Migrated from github.com) commented 3 years ago
Owner
                            "Authorization": "Basic " + this.encodeB64(this.basicauth_user, this.basicauth_pass),
```suggestion "Authorization": "Basic " + this.encodeB64(this.basicauth_user, this.basicauth_pass), ```
Saibamen (Migrated from github.com) commented 3 years ago
Owner
                    let basicAuthHeader = {};
```suggestion let basicAuthHeader = {}; ```
Saibamen (Migrated from github.com) commented 3 years ago
Owner
                            ...(basicauthHeader),
```suggestion ...(basicauthHeader), ```
Saibamen (Migrated from github.com) commented 3 years ago
Owner

Untranslated placeholders

Untranslated placeholders
ivanbratovic commented 3 years ago (Migrated from github.com)
Poster
Owner

You can add screenshots directly to GitHub. Just paste it to comment field

Thanks for the tip! I've edited the original text.

Also, apreciate your time for the review. I agree with the changes so I'll implement these ASAP.

> You can add screenshots directly to GitHub. Just paste it to comment field Thanks for the tip! I've edited the original text. Also, apreciate your time for the review. I agree with the changes so I'll implement these ASAP.
ivanbratovic commented 3 years ago (Migrated from github.com)
Poster
Owner

Rebased with upstream and implemented @Saibamen's suggestions.

Rebased with upstream and implemented @Saibamen's suggestions.
Saibamen (Migrated from github.com) approved these changes 3 years ago
deefdragon (Migrated from github.com) approved these changes 3 years ago
This pull request can be merged automatically.
You are not authorized to merge this pull request.
Sign in to join this conversation.
Loading…
There is no content yet.