miniominio-client

MinIO webhook event notification config doesn't see provided auth_token


I wanted to use MinIO Webhook Service Notification. The logic I want to have is, when some file is uploaded to bucket1 with prefix "all/", MinIO should send event notification to provided webhook endpoint. For security purposes I have to use auth_token, this is done to accept only event notifications from trusted senders.

What is happening now, I have read the MinIO documentation on how to configure endpoint, and how to add auth_token to configuration. I have created notify_webhook:primary, added endpoint to it https://example.com/webhook/, also added auth_token="mytoken"

And ARN is created

$ mc admin config get dev-minio notify_webhook 
    notify_webhook enable=off endpoint= auth_token= queue_limit=0 queue_dir=client_cert= client_key=  
    notify_webhook:primary endpoint=https://example.com/webhook queue_limit=0 queue_dir= client_cert= client_key=

As I know, there should be one more parameter auth_token, if shouldn'tI have tried the following command: mc admin config get dev-minio notify_webhook --json

And here is the output:

{
  "status": "success",
  "config": [
    {
      "subSystem": "notify_webhook",
      "kv": [
        {
          "key": "enable",
          "value": "off"
        },
        {
          "key": "endpoint",
          "value": ""
        },
        {
          "key": "auth_token",
          "value": ""
        },
        {
          "key": "queue_limit",
          "value": "0"
        },
        {
          "key": "queue_dir",
          "value": ""
        },
        {
          "key": "client_cert",
          "value": ""
        },
        {
          "key": "client_key",
          "value": ""
        }
      ]
    },
    {
      "subSystem": "notify_webhook",
      "target": "primary",
      "kv": [
        {
          "key": "endpoint",
          "value": "https://example.com"
        },
        {
          "key": "queue_limit",
          "value": "0"
        },
        {
          "key": "queue_dir",
          "value": ""
        },
        {
          "key": "client_cert",
          "value": ""
        },
        {
          "key": "client_key",
          "value": ""
        }
      ]
    }
  ]
}

When I try to send request to the endpoint using postman (curl as well), with authentication header, everything works perfectly.

I don't know what am I doing wrong, please help if you faced the same issue

I have tried to configure using Environment Variables, as well as using configuration settings using mc client

I have tried to configure using this command:

mc admin config set dev-minio notify_webhook:primary \
endpoint="https://example.com/webhook" \
auth_token="mytoken"

I have tried to configure separately every parameters of config:

mc admin config set dev-minio notify_webhook:primary endpoint="https://example.com/webhook" 
mc admin config set dev-minio notify_webhook:primary auth_token="mytoken"

P.S: I am running MinIO in docker container on my Cloud Server


Solution

  • I dug into it and here’s what fixed my setup:

    Verifying the auth_token in MinIO’s config:

    Handling the “Bearer” prefix:

    URL-encoding of object keys