Skip to content

Commit 77094bd

Browse files
committed
Update JWT authentication documentation across export and import plugins including use of partials.
1 parent 86d8a63 commit 77094bd

File tree

8 files changed

+48
-82
lines changed

8 files changed

+48
-82
lines changed

modules/ROOT/pages/exportpdf.adoc

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
= {pluginname} plugin
22
:plugincode: exportpdf
33
:pluginname: Export to PDF
4+
:pluginfilename: export-to-pdf
45
:navtitle: {pluginname}
56
:description: The {pluginname} feature provides the ability to generate a PDF file directly from the editor.
67
:description_short: Generate a PDF file directly from the editor.
@@ -22,8 +23,7 @@ liveDemo::exportpdf[]
2223

2324
To add the {pluginname} plugin to the editor, add `{plugincode}` to the `plugins` option in the editor configuration.
2425

25-
For example:
26-
26+
.Example:
2727
[source,js]
2828
----
2929
tinymce.init({
@@ -41,37 +41,16 @@ tinymce.init({
4141
});
4242
----
4343

44-
[NOTE]
4544
For more infomation on the exportpdf_token_provider option, see xref:exportpdf.adoc#exportpdf-token-provider[exportpdf_token_provider].
4645

47-
[IMPORTANT]
48-
====
49-
The {pluginname} plugin **requires** JWT authentication when using the {companyname} Cloud service.
50-
51-
* Configure the `{plugincode}_token_provider` option to specify the endpoint for retrieving a valid JWT token.
52-
* If hosting locally, use the format `+http://localhost:[port]/jwt+`, ensuring the endpoint returns a xref:importword.adoc#data-structure[JSON] containing the token.
53-
54-
For more information on how to set up JWT authentication with {pluginname}, see examples:
46+
include::partial$misc/admon-jwt-authentication-requirements.adoc[]
5547

56-
* xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[Export to PDF with JWT authentication (Node.js)]
57-
* xref:export-to-pdf-with-jwt-authentication-php.adoc[Export to PDF with JWT authentication (PHP)]
58-
59-
**Trial period behavior:**
60-
61-
* The {pluginname} plugin runs in evaluation mode and adds a watermark to exported content.
62-
* The `{plugincode}_token_provider` option is "not required" during the trial period.
63-
* If the trial period "expires" or the plugin lacks the necessary entitlement, it becomes _non-functional_.
64-
* Attempting to use JWT authentication during the trial will result in an _error_.
65-
====
66-
67-
include::partial$misc/admon-document-converters-jwt-expected-data-structure.adoc[]
6848

6949
== Basic setup using the self-hosted service
7050

7151
To use the self-hosted version of the {pluginname} plugin, you need to set the `exportpdf_service_url` option to the URL of the service.
7252

73-
For example:
74-
53+
.Example:
7554
[source,js]
7655
----
7756
tinymce.init({

modules/ROOT/pages/exportword.adoc

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
= {pluginname} plugin
22
:plugincode: exportword
33
:pluginname: Export to Word
4+
:pluginfilename: export-to-word
45
:navtitle: {pluginname}
56
:description: The {pluginname} feature lets you generate a .docx (Microsoft Word document) file directly from the editor.
67
:description_short: Generate a .docx file directly from the editor.
@@ -47,41 +48,16 @@ tinymce.init({
4748
});
4849
----
4950

50-
[NOTE]
5151
For more infomation on the exportword_token_provider option, see xref:exportword.adoc#exportword-token-provider[exportword_token_provider]
5252

53-
[IMPORTANT]
54-
====
55-
The {pluginname} plugin **requires** JWT authentication when using the {companyname} Cloud service.
56-
57-
* Configure the `{plugincode}_token_provider` option to specify the endpoint for retrieving a valid JWT token.
58-
* If hosting locally, use the format `+http://localhost:[port]/jwt+`, ensuring the endpoint returns a xref:exportword.adoc#data-structure[JSON] containing the token.
59-
60-
For more information on how to set up JWT authentication with {pluginname}, see examples:
61-
62-
* xref:export-to-word-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
63-
* xref:export-to-word-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]
64-
65-
**Trial period behavior:**
66-
67-
* The {pluginname} plugin runs in evaluation mode and adds a watermark to exported content.
68-
* The `{plugincode}_token_provider` option is "not required" during the trial period.
69-
* If the trial period "expires" or the plugin lacks the necessary entitlement, it becomes _non-functional_.
70-
* Attempting to use JWT authentication during the trial will result in an _error_.
71-
====
72-
73-
include::partial$misc/admon-document-converters-jwt-expected-data-structure.adoc[]
74-
75-
76-
77-
53+
include::partial$misc/admon-jwt-authentication-requirements.adoc[]
7854

7955

8056
== Basic setup using the self-hosted service
8157

8258
To use the self-hosted version of the {pluginname} plugin, you need to set the `exportword_service_url` option to the URL of the service.
8359

84-
For example:
60+
.Example:
8561
[source,js]
8662
----
8763
tinymce.init({

modules/ROOT/pages/importword.adoc

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
= {pluginname} plugin
33
:plugincode: importword
44
:pluginname: Import from Word
5+
:pluginfilename: import-from-word
56
:navtitle: {pluginname}
67
:description: Provides a way to import .docx (Microsoft Word documents) or .dotx (Microsoft Word templates) files into the editor.
78
:description_short: Import .docx or .dotx files into the editor.
@@ -42,37 +43,16 @@ tinymce.init({
4243
});
4344
----
4445

45-
[NOTE]
4646
For more infomation on the importword_token_provider option, see xref:importword.adoc#importword-token-provider[importword_token_provider].
4747

48-
[IMPORTANT]
49-
====
50-
The {pluginname} plugin **requires** JWT authentication when using the {companyname} Cloud service.
51-
52-
* Configure the `{plugincode}_token_provider` option to specify the endpoint for retrieving a valid JWT token.
53-
* If hosting locally, use the format `+http://localhost:[port]/jwt+`, ensuring the endpoint returns a xref:importword.adoc#data-structure[JSON] containing the token.
54-
55-
For more information on how to set up JWT authentication with {pluginname}, see examples:
56-
57-
* xref:import-from-word-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
58-
* xref:import-from-word-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]
48+
include::partial$misc/admon-jwt-authentication-requirements.adoc[]
5949

60-
**Trial period behavior:**
61-
62-
* The {pluginname} plugin runs in evaluation mode and adds a watermark to exported content.
63-
* The `{plugincode}_token_provider` option is "not required" during the trial period.
64-
* If the trial period "expires" or the plugin lacks the necessary entitlement, it becomes _non-functional_.
65-
* Attempting to use JWT authentication during the trial will result in an _error_.
66-
====
67-
68-
include::partial$misc/admon-document-converters-jwt-expected-data-structure.adoc[]
6950

7051
== Basic setup using the self-hosted service
7152

7253
To use the self-hosted version of the {pluginname} plugin, you need to set the `importword_service_url` option to the URL of the service.
7354

74-
For example:
75-
55+
.Example:
7656
[source,js]
7757
----
7858
tinymce.init({

modules/ROOT/partials/configuration/exportpdf_token_provider.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The `exportpdf_token_provider` option enables integration with a token-based aut
77

88
*Default value:* `undefined`
99

10+
*Return data:* xref:exportpdf.adoc#data-structure[`Token` object]
11+
1012
=== Example: using `exportpdf_token_provider`
1113

1214
[source,js]
@@ -22,4 +24,6 @@ tinymce.init({
2224
}).then(response => response.json());
2325
},
2426
});
25-
----
27+
----
28+
29+
include::partial$misc/admon-document-converters-jwt-expected-data-structure.adoc[]

modules/ROOT/partials/configuration/exportword_token_provider.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The `exportword_token_provider` option enables integration with a token-based au
77

88
*Default value:* `undefined`
99

10+
*Return data:* xref:exportword.adoc#data-structure[`Token` object]
11+
1012
=== Example: using `exportword_token_provider`
1113

1214
[source,js]
@@ -22,4 +24,6 @@ tinymce.init({
2224
}).then(response => response.json());
2325
},
2426
});
25-
----
27+
----
28+
29+
include::partial$misc/admon-document-converters-jwt-expected-data-structure.adoc[]

modules/ROOT/partials/configuration/importword_token_provider.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The `importword_token_provider` option enables integration with a token-based au
77

88
*Default value:* `undefined`
99

10+
*Return data:* xref:importword.adoc#data-structure[`Token` object]
11+
1012
=== Example: using `importword_token_provider`
1113

1214
[source,js]
@@ -22,4 +24,6 @@ tinymce.init({
2224
}).then(response => response.json());
2325
},
2426
});
25-
----
27+
----
28+
29+
include::partial$misc/admon-document-converters-jwt-expected-data-structure.adoc[]

modules/ROOT/partials/misc/admon-document-converters-jwt-expected-data-structure.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
== Data structure
1+
[[data-structure]]
2+
=== Data structure for the JWT token
23

3-
The JSON data containing the valid encoded token must match the following structure:
4+
The object containing the valid encoded token must match the following structure:
45

5-
[source,json]
6+
[source,js]
67
----
78
{
8-
"token": "<encoded JWT string>"
9+
token: "<encoded JWT string>"
910
}
1011
----
1112

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[IMPORTANT]
2+
====
3+
The {pluginname} plugin **requires** JWT authentication when using the {companyname} Cloud service.
4+
5+
* Configure the `{plugincode}_token_provider` option to specify the endpoint for retrieving a valid JWT token.
6+
7+
For more information on how to set up JWT authentication with {pluginname}, see examples:
8+
9+
* xref:{pluginfilename}-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
10+
* xref:{pluginfilename}-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]
11+
12+
**Trial period behavior:**
13+
14+
* The {pluginname} plugin runs in evaluation mode and adds a watermark to exported content.
15+
* The `{plugincode}_token_provider` option is "not required" during the trial period.
16+
* If the trial period "expires" or the plugin lacks the necessary entitlement, it becomes _non-functional_.
17+
* Attempting to use JWT authentication during the trial will result in an _error_.
18+
====

0 commit comments

Comments
 (0)