Browse code

docs: fix base64 encoding description for secrets and configs

The API documentation incorrectly stated that the Data field for
secrets and configs should use Base64-url-safe-encoded format
(RFC 4648 section 5). However, Docker actually uses standard base64
encoding (RFC 4648 section 4).

This caused confusion when users tried to use URL-safe base64 encoding
and received "illegal base64 data" errors.

Update the documentation to correctly reference RFC 4648 section 4
(standard base64) instead of section 5 (URL-safe base64).

Fixes #37671

Signed-off-by: majiayu000 <1835304752@qq.com>

majiayu000 authored on 2025/12/26 18:42:08
Showing 1 changed files
... ...
@@ -5700,8 +5700,8 @@ definitions:
5700 5700
           com.example.some-other-label: "some-other-value"
5701 5701
       Data:
5702 5702
         description: |
5703
-          Data is the data to store as a secret, formatted as a Base64-url-safe-encoded
5704
-          ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string.
5703
+          Data is the data to store as a secret, formatted as a standard base64-encoded
5704
+          ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string.
5705 5705
           It must be empty if the Driver field is set, in which case the data is
5706 5706
           loaded from an external secret store. The maximum allowed size is 500KB,
5707 5707
           as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize).
... ...
@@ -5755,8 +5755,8 @@ definitions:
5755 5755
           type: "string"
5756 5756
       Data:
5757 5757
         description: |
5758
-          Data is the data to store as a config, formatted as a Base64-url-safe-encoded
5759
-          ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string.
5758
+          Data is the data to store as a config, formatted as a standard base64-encoded
5759
+          ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string.
5760 5760
           The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize).
5761 5761
         type: "string"
5762 5762
       Templating: