@kronos-integration/service-systemd 2.7.3 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -3
- package/package.json +3 -3
- package/src/service.mjs +15 -4
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ kronos systemd integration
|
|
|
27
27
|
* [JournalLogger](#journallogger)
|
|
28
28
|
* [FileDescriptor](#filedescriptor)
|
|
29
29
|
* [Properties](#properties)
|
|
30
|
+
* [credentialsDirectory](#credentialsdirectory)
|
|
30
31
|
* [SystemdConfig](#systemdconfig)
|
|
31
32
|
* [Properties](#properties-1)
|
|
32
33
|
* [listeningFileDescriptors](#listeningfiledescriptors)
|
|
@@ -34,6 +35,8 @@ kronos systemd integration
|
|
|
34
35
|
* [ServiceSystemd](#servicesystemd)
|
|
35
36
|
* [getCredential](#getcredential)
|
|
36
37
|
* [Parameters](#parameters)
|
|
38
|
+
* [getCredentials](#getcredentials)
|
|
39
|
+
* [Parameters](#parameters-1)
|
|
37
40
|
* [endpoints](#endpoints)
|
|
38
41
|
|
|
39
42
|
## JournalLogger
|
|
@@ -51,6 +54,10 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
|
|
|
51
54
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
52
55
|
* `fd` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
|
53
56
|
|
|
57
|
+
## credentialsDirectory
|
|
58
|
+
|
|
59
|
+
Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
60
|
+
|
|
54
61
|
## SystemdConfig
|
|
55
62
|
|
|
56
63
|
**Extends ServiceConfig**
|
|
@@ -87,14 +94,25 @@ Kronos bridge to systemd:
|
|
|
87
94
|
|
|
88
95
|
### getCredential
|
|
89
96
|
|
|
90
|
-
Deliver
|
|
97
|
+
Deliver credential as provided by systemd.
|
|
91
98
|
|
|
92
99
|
#### Parameters
|
|
93
100
|
|
|
94
101
|
* `key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
95
|
-
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
102
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
103
|
+
|
|
104
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<([Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))>** 
|
|
105
|
+
|
|
106
|
+
### getCredentials
|
|
107
|
+
|
|
108
|
+
Deliver credentials as provided by systemd.
|
|
109
|
+
|
|
110
|
+
#### Parameters
|
|
111
|
+
|
|
112
|
+
* `keys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
113
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
96
114
|
|
|
97
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<([
|
|
115
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<([Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))>>** 
|
|
98
116
|
|
|
99
117
|
### endpoints
|
|
100
118
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/service-systemd",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": false
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"cmake-js": "^7.3.1",
|
|
42
42
|
"documentation": "^14.0.3",
|
|
43
43
|
"execa": "^9.6.0",
|
|
44
|
-
"node-addon-api": "^8.
|
|
44
|
+
"node-addon-api": "^8.5.0",
|
|
45
45
|
"semantic-release": "^24.2.0"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": ">=22.
|
|
48
|
+
"node": ">=22.17.1"
|
|
49
49
|
},
|
|
50
50
|
"os": [
|
|
51
51
|
"linux"
|
package/src/service.mjs
CHANGED
|
@@ -45,7 +45,8 @@ class JournalLogger extends ServiceLogger {
|
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
const configurationDirectory = process.env.CONFIGURATION_DIRECTORY;
|
|
48
|
-
const credentialsDirectory =
|
|
48
|
+
const /** @typedef {string} */ credentialsDirectory =
|
|
49
|
+
process.env.CREDENTIALS_DIRECTORY;
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* Provides config from CONFIGURATION_DIRECTORY.
|
|
@@ -158,15 +159,25 @@ export class ServiceSystemd extends ServiceProviderMixin(
|
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
/**
|
|
161
|
-
* Deliver
|
|
162
|
+
* Deliver credential as provided by systemd.
|
|
162
163
|
* @param {string} key
|
|
163
|
-
* @param {Object} options
|
|
164
|
-
* @return {Promise<
|
|
164
|
+
* @param {Object?} options
|
|
165
|
+
* @return {Promise<Uint8Array|string>}
|
|
165
166
|
*/
|
|
166
167
|
async getCredential(key, options) {
|
|
167
168
|
return readFile(join(credentialsDirectory, key), options);
|
|
168
169
|
}
|
|
169
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Deliver credentials as provided by systemd.
|
|
173
|
+
* @param {string[]} keys
|
|
174
|
+
* @param {Object?} options
|
|
175
|
+
* @return {Promise<(Uint8Array|string)[]>}
|
|
176
|
+
*/
|
|
177
|
+
async getCredentials(keys, options) {
|
|
178
|
+
return Promise.all(keys.map(key => this.getCredential(key, options)));
|
|
179
|
+
}
|
|
180
|
+
|
|
170
181
|
/**
|
|
171
182
|
* Definition of the predefined endpoints.
|
|
172
183
|
* - info _in_
|