Skip to content

Commit 50d19a4

Browse files
authored
Merge pull request #94 from puppetlabs/CONT-1048-remove_deprecated_file_type
(CONT-1048) - Removal of deprecated node_encrypt::file defined type
2 parents a1cc8c6 + 61171ba commit 50d19a4

File tree

6 files changed

+7
-420
lines changed

6 files changed

+7
-420
lines changed

Gemfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ group :development do
3030
gem "pry", '~> 0.10', require: false
3131
gem "simplecov-console", '~> 0.5', require: false
3232
gem "puppet-debugger", '~> 1.0', require: false
33-
gem "rubocop", '~> 1.48.1', require: false
34-
gem "rubocop-performance", '~> 1.16', require: false
35-
gem "rubocop-rspec", '~> 2.19', require: false
33+
gem "rubocop", '= 1.48.1', require: false
34+
gem "rubocop-performance", '= 1.16.0', require: false
35+
gem "rubocop-rspec", '= 2.19.0', require: false
3636
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3737
end
3838
group :system_tests do

README.md

-9
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ built secret server. See [docs](https://puppet.com/docs/puppet/latest/integratio
9696
* `node_encrypt::certificates`
9797
* This class will synchronize certificates to all compile servers.
9898
* Generally not needed, unless the `clientcert_pem` fact fails for some reason.
99-
* `node_encrypt::file`
100-
* Legacy type for backwards code compatibility.
101-
* It just invokes the deferred functions for you so that your old code will
102-
continue to compile. This means that it now requires Puppet 6.x+. You should
103-
migrate to the deferred function as soon as possible, as this type will be
104-
removed in the next major version.
105-
* This is a defined type that wraps a standard file resource, but allows you
106-
to encrypt the content in the catalog and reports.
10799

108100
The simplest usage is like the example shown in the [Overview](#overview). This
109101
defined type accepts most of the standard file parameters and simply encrypts the
@@ -297,7 +289,6 @@ functions:
297289
returns: '-----BEGIN PKCS7----- MOCKED_DATA'
298290
```
299291
300-
(Note, the text of the mock return is important for users of the `node_encrypt::file` defined type.)
301292
302293
303294
## Limitations

REFERENCE.md

+3-216
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@
88

99
* [`node_encrypt::certificates`](#node_encrypt--certificates): Class: node_encrypt::certificates This class distributes public certificates from your CA node to all compile server configurations. It is r
1010

11-
### Defined types
12-
13-
* [`node_encrypt::file`](#node_encrypt--file): Notice: This defined type is deprecated and only used for backward code compatibility. This uses the modern deferred function under the hood
14-
1511
### Functions
1612

1713
* [`node_decrypt`](#node_decrypt): Decrypt data with node_encrypt. This is intended to be used as a Deferred function on the _agent_ via the node_encrypted::secret wrapper.
1814
* [`node_encrypt`](#node_encrypt): Encrypt data with node_encrypt.
1915
* [`node_encrypt`](#node_encrypt): This function simply encrypts the String or Sensitive passed to it using the certificate belonging to the client the catalog is being compile
20-
* [`node_encrypt::secret`](#node_encrypt--secret)
16+
* [`node_encrypt::secret`](#node_encrypt--secret): This function encrypts a string on the server, and then decrypts it on the agent during catalog application.
2117
* [`redact`](#redact): This function will modify the catalog during compilation to remove the named parameter from the class from which it was called. For example,
2218

2319
## Classes
@@ -73,215 +69,6 @@ Data type: `Integer`
7369

7470
Default value: `300`
7571

76-
## Defined types
77-
78-
### <a name="node_encrypt--file"></a>`node_encrypt::file`
79-
80-
Notice:
81-
This defined type is deprecated and only used for backward code compatibility.
82-
This uses the modern deferred function under the hood and will be removed in
83-
the next major release. That means that this module now REQUIRES Puppet 6.x+.
84-
85-
Parameters:
86-
[*ensure*]
87-
Specifies the desired state of the file. Valid values are 'absent', 'present', or 'file'.
88-
89-
[*path*]
90-
The path to the file.
91-
92-
[*backup*]
93-
(Optional) Whether to create backups of the file when it changes.
94-
95-
[*checksum*]
96-
(Optional) The checksum type to use for file content validation.
97-
98-
[*content*]
99-
(Optional) The content of the file. This will be encrypted with node_encrypt() and passed to
100-
an instance of the node_encrypted_file type, which will provide the content to the file.
101-
102-
[*encrypted_content*]
103-
(Optional) The encrypted content of the file. If specified, it will be decrypted and used as
104-
the content of the file.
105-
106-
[*force*]
107-
(Optional) Whether to force file updates even if the file is managed by another system.
108-
109-
[*group*]
110-
(Optional) The group ownership of the file.
111-
112-
[*owner*]
113-
(Optional) The owner of the file.
114-
115-
[*mode*]
116-
(Optional) The file mode or permission settings.
117-
118-
[*replace*]
119-
(Optional) Whether to replace the file if it already exists.
120-
121-
[*selinux_ignore_defaults*]
122-
(Optional) Whether to ignore SELinux defaults when managing the file.
123-
124-
[*selrange*]
125-
(Optional) The SELinux range for the file.
126-
127-
[*selrole*]
128-
(Optional) The SELinux role for the file.
129-
130-
[*seltype*]
131-
(Optional) The SELinux type for the file.
132-
133-
[*seluser*]
134-
(Optional) The SELinux user for the file.
135-
136-
#### Parameters
137-
138-
The following parameters are available in the `node_encrypt::file` defined type:
139-
140-
* [`ensure`](#-node_encrypt--file--ensure)
141-
* [`path`](#-node_encrypt--file--path)
142-
* [`backup`](#-node_encrypt--file--backup)
143-
* [`checksum`](#-node_encrypt--file--checksum)
144-
* [`content`](#-node_encrypt--file--content)
145-
* [`encrypted_content`](#-node_encrypt--file--encrypted_content)
146-
* [`force`](#-node_encrypt--file--force)
147-
* [`group`](#-node_encrypt--file--group)
148-
* [`owner`](#-node_encrypt--file--owner)
149-
* [`mode`](#-node_encrypt--file--mode)
150-
* [`replace`](#-node_encrypt--file--replace)
151-
* [`selinux_ignore_defaults`](#-node_encrypt--file--selinux_ignore_defaults)
152-
* [`selrange`](#-node_encrypt--file--selrange)
153-
* [`selrole`](#-node_encrypt--file--selrole)
154-
* [`seltype`](#-node_encrypt--file--seltype)
155-
* [`seluser`](#-node_encrypt--file--seluser)
156-
157-
##### <a name="-node_encrypt--file--ensure"></a>`ensure`
158-
159-
Data type: `Enum['absent', 'present', 'file']`
160-
161-
162-
163-
Default value: `'file'`
164-
165-
##### <a name="-node_encrypt--file--path"></a>`path`
166-
167-
Data type: `String[1]`
168-
169-
170-
171-
Default value: `$title`
172-
173-
##### <a name="-node_encrypt--file--backup"></a>`backup`
174-
175-
Data type: `Optional[Boolean]`
176-
177-
178-
179-
Default value: `undef`
180-
181-
##### <a name="-node_encrypt--file--checksum"></a>`checksum`
182-
183-
Data type: `Optional[String[1]]`
184-
185-
186-
187-
Default value: `undef`
188-
189-
##### <a name="-node_encrypt--file--content"></a>`content`
190-
191-
Data type: `Optional[String[1]]`
192-
193-
194-
195-
Default value: `undef`
196-
197-
##### <a name="-node_encrypt--file--encrypted_content"></a>`encrypted_content`
198-
199-
Data type: `Optional[String[1]]`
200-
201-
202-
203-
Default value: `undef`
204-
205-
##### <a name="-node_encrypt--file--force"></a>`force`
206-
207-
Data type: `Optional[Boolean]`
208-
209-
210-
211-
Default value: `undef`
212-
213-
##### <a name="-node_encrypt--file--group"></a>`group`
214-
215-
Data type: `Optional[String[1]]`
216-
217-
218-
219-
Default value: `undef`
220-
221-
##### <a name="-node_encrypt--file--owner"></a>`owner`
222-
223-
Data type: `Optional[String[1]]`
224-
225-
226-
227-
Default value: `undef`
228-
229-
##### <a name="-node_encrypt--file--mode"></a>`mode`
230-
231-
Data type: `Optional[Stdlib::Filemode]`
232-
233-
234-
235-
Default value: `undef`
236-
237-
##### <a name="-node_encrypt--file--replace"></a>`replace`
238-
239-
Data type: `Optional[Boolean]`
240-
241-
242-
243-
Default value: `undef`
244-
245-
##### <a name="-node_encrypt--file--selinux_ignore_defaults"></a>`selinux_ignore_defaults`
246-
247-
Data type: `Optional[Boolean]`
248-
249-
250-
251-
Default value: `undef`
252-
253-
##### <a name="-node_encrypt--file--selrange"></a>`selrange`
254-
255-
Data type: `Optional[String[1]]`
256-
257-
258-
259-
Default value: `undef`
260-
261-
##### <a name="-node_encrypt--file--selrole"></a>`selrole`
262-
263-
Data type: `Optional[String[1]]`
264-
265-
266-
267-
Default value: `undef`
268-
269-
##### <a name="-node_encrypt--file--seltype"></a>`seltype`
270-
271-
Data type: `Optional[String[1]]`
272-
273-
274-
275-
Default value: `undef`
276-
277-
##### <a name="-node_encrypt--file--seluser"></a>`seluser`
278-
279-
Data type: `Optional[String[1]]`
280-
281-
282-
283-
Default value: `undef`
284-
28572
## Functions
28673

28774
### <a name="node_decrypt"></a>`node_decrypt`
@@ -352,11 +139,11 @@ Returns: `Any`
352139

353140
Type: Puppet Language
354141

355-
The node_encrypt::secret function.
142+
This function encrypts a string on the server, and then decrypts it on the agent during catalog application.
356143

357144
#### `node_encrypt::secret(Variant[String, Sensitive[String]] $data)`
358145

359-
The node_encrypt::secret function.
146+
This function encrypts a string on the server, and then decrypts it on the agent during catalog application.
360147

361148
Returns: `Deferred`
362149

functions/secret.pp

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# This function encrypts a string on the server, and then decrypts it on the agent during catalog application.
12
function node_encrypt::secret(Variant[String, Sensitive[String]] $data) >> Deferred {
23
Deferred('node_decrypt', [node_encrypt($data)])
34
}

0 commit comments

Comments
 (0)