operator icon indicating copy to clipboard operation
operator copied to clipboard

VMUser introduce an option for backend authorization.

Open f41gh7 opened this issue 2 years ago • 2 comments

It would be great to have an option to define Bearer token or Basic Auth configuration for targets.

For instance:

kind: VMUser
  spec
    targetRefs:
     paths:
     - static:
       - ursl: [http://host1:8429,http://host2:8429,http://host3:8429]
       basicAuth:
        password:
          key: password
          name: secretname
        username:
          key: username
         name: secretname

Must produce following vmauth config with Authorization header:

users:
- username: "user"
  password: "***"
  headers:
  - Authorization: Basic BASE64_ENCODED_VALUE
  url_prefix:
  - "http://host1:8429/"
  - "http://host2:8429/"
  - "http://host3:8429/"

It's safe to store headers at configuration file, since it uses secure kubernetes secret.

For multiple, url_map headers should be used.

Related issue https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4361

f41gh7 avatar Jun 18 '23 13:06 f41gh7

Can I send a pull request for this feature?

mohammadkhavari avatar Jul 20 '23 13:07 mohammadkhavari

Can I send a pull request for this feature?

Feel free)

Haleygo avatar Jul 20 '23 13:07 Haleygo

@Haleygo @f41gh7 I see this FR was implemented in operator repo. Should we close this ticket as done or follow-up in vmauth is required?

hagen1778 avatar May 06 '24 07:05 hagen1778