| 1 |
# -*- coding: utf-8 -*- |
| 2 |
|
| 3 |
# Copyright: (c) 2022, Brian Scholer (@briantist) |
| 4 |
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 5 |
# SPDX-License-Identifier: GPL-3.0-or-later |
| 6 |
|
| 7 |
from __future__ import (absolute_import, division, print_function) |
| 8 |
__metaclass__ = type |
| 9 |
|
| 10 |
|
| 11 |
class ModuleDocFragment(object): |
| 12 |
|
| 13 |
DOCUMENTATION = r''' |
| 14 |
options: |
| 15 |
orphan: |
| 16 |
description: |
| 17 |
- When C(true), uses the C(/create-orphan) API endpoint, which requires C(sudo) (but not C(root)) to create an orphan. |
| 18 |
- With C(hvac>=1.0.0), requires collection version C(>=3.3.0). |
| 19 |
type: bool |
| 20 |
default: false |
| 21 |
no_parent: |
| 22 |
description: |
| 23 |
- This option only has effect if used by a C(root) or C(sudo) caller and only when I(orphan=false). |
| 24 |
- When C(true), the token created will not have a parent. |
| 25 |
type: bool |
| 26 |
no_default_policy: |
| 27 |
description: |
| 28 |
- If C(true) the default policy will not be contained in this token's policy set. |
| 29 |
- If the token will be used with this collection, set I(token_validate=false). |
| 30 |
type: bool |
| 31 |
policies: |
| 32 |
description: |
| 33 |
- A list of policies for the token. This must be a subset of the policies belonging to the token making the request, unless root. |
| 34 |
- If not specified, defaults to all the policies of the calling token. |
| 35 |
type: list |
| 36 |
elements: str |
| 37 |
id: |
| 38 |
description: |
| 39 |
- The ID of the client token. Can only be specified by a root token. |
| 40 |
- The ID provided may not contain a C(.) character. |
| 41 |
- Otherwise, the token ID is a randomly generated value. |
| 42 |
type: str |
| 43 |
role_name: |
| 44 |
description: |
| 45 |
- The name of the token role. If used, the token will be created against the specified role name which may override options set during this call. |
| 46 |
type: str |
| 47 |
meta: |
| 48 |
description: A dict of string to string valued metadata. This is passed through to the audit devices. |
| 49 |
type: dict |
| 50 |
renewable: |
| 51 |
description: |
| 52 |
- Set to C(false) to disable the ability of the token to be renewed past its initial TTL. |
| 53 |
- Setting the value to C(true) will allow the token to be renewable up to the system/mount maximum TTL. |
| 54 |
type: bool |
| 55 |
ttl: |
| 56 |
description: |
| 57 |
- The TTL period of the token, provided as C(1h) for example, where hour is the largest suffix. |
| 58 |
- If not provided, the token is valid for the default lease TTL, or indefinitely if the root policy is used. |
| 59 |
type: str |
| 60 |
type: |
| 61 |
description: The token type. The default is determined by the role configuration specified by I(role_name). |
| 62 |
type: str |
| 63 |
choices: |
| 64 |
- batch |
| 65 |
- service |
| 66 |
explicit_max_ttl: |
| 67 |
description: |
| 68 |
- If set, the token will have an explicit max TTL set upon it. |
| 69 |
- This maximum token TTL cannot be changed later, |
| 70 |
and unlike with normal tokens, updates to the system/mount max TTL value will have no effect at renewal time. |
| 71 |
- The token will never be able to be renewed or used past the value set at issue time. |
| 72 |
type: str |
| 73 |
display_name: |
| 74 |
description: The display name of the token. |
| 75 |
type: str |
| 76 |
num_uses: |
| 77 |
description: |
| 78 |
- The maximum uses for the given token. This can be used to create a one-time-token or limited use token. |
| 79 |
- The value of C(0) has no limit to the number of uses. |
| 80 |
type: int |
| 81 |
period: |
| 82 |
description: |
| 83 |
- If specified, the token will be periodic. |
| 84 |
- It will have no maximum TTL (unless an I(explicit_max_ttl) is also set) but every renewal will use the given period. |
| 85 |
- Requires a root token or one with the C(sudo) capability. |
| 86 |
type: str |
| 87 |
entity_alias: |
| 88 |
description: |
| 89 |
- Name of the entity alias to associate with during token creation. |
| 90 |
- Only works in combination with I(role_name) option and used entity alias must be listed in C(allowed_entity_aliases). |
| 91 |
- If this has been specified, the entity will not be inherited from the parent. |
| 92 |
type: str |
| 93 |
''' |