Middleware basic auth secret format

Hi

I am planning to add a basic auth middleware to traefik in k8s and as such I am following the guide at https://doc.traefik.io/traefik/middlewares/basicauth/. In here the example secret for storing the username:password is as such

apiVersion: v1
kind: Secret
metadata:
  name: authsecret
  namespace: default

data:
  users: |2
    dGVzdDokYXByMSRINnVza2trVyRJZ1hMUDZld1RyU3VCa1RycUU4d2ovCnRlc3QyOiRhcHIxJGQ5
    aHI5SEJCJDRIeHdnVWlyM0hQNEVzZ2dQL1FObzAK

I can get the base64 encoded part and I can see that 2 usernames and passwords are defined. But what is the "2" for?

Hello,

the 2 is the indentation indicator: https://yaml.org/spec/1.2/spec.html#id2793979

Ah of course. The fact that the encoded secret had 2 username passwords threw me off. Thanks a lot for the quick reply!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.