This repository was archived by the owner on Nov 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,6 +265,35 @@ def main():
265265 ...
266266```
267267
268+ ### Advanced use of configuration file for authentication based on method
269+
270+ The configuration file can have values that are both generic and specific to the method.
271+ Here's an example where a project has a different API Token for reading and writing values.
272+
273+ ``` bash
274+ $ cat ~ /.cloudflare/cloudflare.cfg
275+ [Work]
276+ token = 0000000000000000000000000000000000000000
277+ token.get = 0123456789012345678901234567890123456789
278+ $
279+ ```
280+
281+ When a GET call is processed then the second token is used. For all other calls the first token is used.
282+ Here's a more explict verion of that config:
283+
284+ ``` bash
285+ $ cat ~ /.cloudflare/cloudflare.cfg
286+ [Work]
287+ token.delete = 0000000000000000000000000000000000000000
288+ token.get = 0123456789012345678901234567890123456789
289+ token.patch = 0000000000000000000000000000000000000000
290+ token.post = 0000000000000000000000000000000000000000
291+ token.put = 0000000000000000000000000000000000000000
292+ $
293+ ```
294+
295+ This can be used with email values also.
296+
268297### About /certificates and certtoken
269298
270299The * CF_API_CERTKEY* or * certtoken* values are used for the Origin-CA * /certificates* API calls.
Original file line number Diff line number Diff line change @@ -303,6 +303,38 @@ Here is the same in code.
303303 cf = CloudFlare.CloudFlare(profile = " Work" )
304304 ...
305305
306+ Advanced use of configuration file for authentication based on method
307+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308+
309+ The configuration file can have values that are both generic and
310+ specific to the method. Here's an example where a project has a
311+ different API Token for reading and writing values.
312+
313+ .. code :: bash
314+
315+ $ cat ~ /.cloudflare/cloudflare.cfg
316+ [Work]
317+ token = 0000000000000000000000000000000000000000
318+ token.get = 0123456789012345678901234567890123456789
319+ $
320+
321+ When a GET call is processed then the second token is used. For all
322+ other calls the first token is used. Here's a more explict verion of
323+ that config:
324+
325+ .. code :: bash
326+
327+ $ cat ~ /.cloudflare/cloudflare.cfg
328+ [Work]
329+ token.delete = 0000000000000000000000000000000000000000
330+ token.get = 0123456789012345678901234567890123456789
331+ token.patch = 0000000000000000000000000000000000000000
332+ token.post = 0000000000000000000000000000000000000000
333+ token.put = 0000000000000000000000000000000000000000
334+ $
335+
336+ This can be used with email values also.
337+
306338About /certificates and certtoken
307339~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308340
You can’t perform that action at this time.
0 commit comments