Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Basic auth encodingURI before base64 #1144

Open
andrei-cdl opened this issue Aug 9, 2021 · 2 comments
Open

Basic auth encodingURI before base64 #1144

andrei-cdl opened this issue Aug 9, 2021 · 2 comments

Comments

@andrei-cdl
Copy link

Unsure why this is the case that I'm experiencing, however with the following config for basic auth

config:
  target: '#'
  phases:
    - name: 'Warm up'
      duration: 1
      arrivalRate: 1
  processor: '../../helper.js'

# Defines the scenario to create a test user
scenarios:
  - flow:
      - log: 'generating new users'
      - post:
          url: '/user'
          beforeRequest:
            - 'set_new_user_body'
          capture:
            - json: '$.id'
              as: 'user_id'
            - json: '$.email'
              as: 'email'

      # user e-mail is created  
      # make sure to decodeURIComponent the user - weird bug.
      - log: 'starting user auth token retrival {{ email }}, {{ user_id }}'
      - get:
          url: '/user/auth'
          auth:
            user: '{{email}}'
            pass: '#'
          capture:
            - json: '$.token'
              as: 'token'

the issue is that the header sent will have the following operations applied to it.

  • encodeURIComponent()
  • base64()

This results in symbols being parsed (@ for example) and not having the correct email value being sent to the server to be decoded using just base64.

@uweku
Copy link

uweku commented Aug 23, 2021

We are having the same issue, obviously. This seems to be the case since release 1.7.0

@andrei-cdl
Copy link
Author

Ah I found a problem reference to this, but I'm unsure if it's related directly as I'm unfamiliar with Artillery (taking over an existing repo). nodejs/node#31439, it fits the same issues I experienced.

As a work around I created a function that adds the value into the header via custom script and handled the encoding myself.

@hassy hassy added this to the 2.0 milestone Nov 10, 2021
@hassy hassy added the bug label Nov 10, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants