emailengine-app 2.83.0 → 2.83.1
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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +11 -0
- package/lib/api-reference/format.js +1 -1
- package/lib/api-routes/export-routes.js +5 -5
- package/lib/api-routes/oauth2-app-routes.js +4 -1
- package/lib/api-routes/route-helpers.js +11 -5
- package/lib/oauth/gcp-metadata.js +50 -13
- package/lib/oauth/gmail.js +12 -6
- package/lib/oauth/verify-app.js +8 -2
- package/lib/oauth2-apps.js +26 -6
- package/lib/swagger-options.js +2 -3
- package/lib/ui-routes/oauth-config-routes.js +14 -15
- package/lib/ui-routes/oauth-form-context.js +19 -0
- package/package.json +1 -1
- package/static/css/flyonui.css +1 -1
- package/views/accounts/account.hbs +0 -5
- package/views/config/oauth/edit.hbs +0 -10
- package/views/config/oauth/new.hbs +0 -10
- package/views/partials/oauth_form.hbs +426 -928
- package/views/partials/oauth_graph_endpoints.hbs +12 -0
- package/views/partials/oauth_pubsub_app_select.hbs +11 -20
- package/views/partials/oauth_scope_presets.hbs +21 -0
- package/views/partials/ui/choice-tab.hbs +23 -0
- package/views/partials/ui/choice-tabs.hbs +32 -0
- package/views/partials/ui/radio.hbs +2 -2
- package/views/partials/ui/secret-field.hbs +2 -1
- package/views/partials/ui/tabs.hbs +1 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{{!-- Where Microsoft Graph posts change notifications, shown by both Microsoft providers in their MS
|
|
2
|
+
Graph API mode. mainServiceUrl comes from the page context. --}}
|
|
3
|
+
<div class="space-y-2">
|
|
4
|
+
<p class="text-sm">Microsoft Graph posts change notifications to these two endpoints, which must accept anonymous
|
|
5
|
+
HTTPS <strong>POST</strong> requests from the internet:</p>
|
|
6
|
+
<pre class="ee-code-block"><code>{{mainServiceUrl}}/oauth/msg/lifecycle
|
|
7
|
+
{{mainServiceUrl}}/oauth/msg/notification</code></pre>
|
|
8
|
+
<span class="helper-text">If this instance cannot be reached directly, set <a href="/admin/reference/settings#postV1Settings"
|
|
9
|
+
target="_blank" rel="noopener noreferrer" class="link link-animated"><code>notificationBaseUrl</code></a>
|
|
10
|
+
to a public proxy domain, and Graph posts to <code>https://<proxy-domain>/oauth/msg/...</code>
|
|
11
|
+
instead.</span>
|
|
12
|
+
</div>
|
|
@@ -2,29 +2,16 @@
|
|
|
2
2
|
interactive `gmail` block and the `gmailService` one: both reach Gmail over the HTTP API, so both want
|
|
3
3
|
the same control, and the server-side `pubSubApp` field was never provider-specific.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It sits in the API panel of the base scope card, and checkScopesRadio() at the bottom of oauth_form.hbs
|
|
6
|
+
disables it while that panel is hidden, so a hidden selection is never submitted. --}}
|
|
6
7
|
|
|
7
|
-
<div
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
For faster webhook notifications, select a Gmail service account with the Pub/Sub Admin role.
|
|
12
|
-
EmailEngine uses it to set up Google Cloud Pub/Sub for accounts managed by this app.
|
|
13
|
-
</p>
|
|
14
|
-
|
|
15
|
-
<p class="mb-2">
|
|
16
|
-
<strong>Note:</strong> This is optional but recommended. With a Pub/Sub service account, EmailEngine
|
|
17
|
-
receives changes in near real time. Without one, it falls back to polling each account about every 10
|
|
18
|
-
minutes, so webhooks for new, updated, or deleted emails (and bounce detection) still fire, just with up
|
|
19
|
-
to a 10-minute delay. Send-only accounts don't require this.
|
|
20
|
-
</p>
|
|
21
|
-
|
|
22
|
-
<label class="label-text" for="pubSubApp">Select service account to manage webhooks (optional). The service
|
|
23
|
-
account must be for the same Google Cloud Project.</label>
|
|
24
|
-
<select class="select w-full{{#if errors.pubSubApp}} is-invalid{{/if}}" id="pubSubApp"
|
|
8
|
+
<div>
|
|
9
|
+
<label class="label-text" for="pubSubApp">Pub/Sub app for real-time notifications <span
|
|
10
|
+
class="text-base-content/60">(optional)</span></label>
|
|
11
|
+
<select class="select max-w-xl{{#if errors.pubSubApp}} is-invalid{{/if}}" id="pubSubApp"
|
|
25
12
|
name="pubSubApp" {{#unless baseScopesApi}}disabled{{/unless}}>
|
|
26
13
|
|
|
27
|
-
<option value="">
|
|
14
|
+
<option value="">No Pub/Sub app - poll for changes</option>
|
|
28
15
|
|
|
29
16
|
{{!-- Nothing disables an option here: the select carries that for the whole control, and
|
|
30
17
|
filterPubSubApps() in oauth_form.hbs owns the per-option state so the two cannot fight. An
|
|
@@ -40,4 +27,8 @@ the same control, and the server-side `pubSubApp` field was never provider-speci
|
|
|
40
27
|
{{#if errors.pubSubApp}}
|
|
41
28
|
<span class="helper-text text-error">{{errors.pubSubApp}}</span>
|
|
42
29
|
{{/if}}
|
|
30
|
+
<span class="helper-text">Without one, EmailEngine polls each account about every 10 minutes, so webhooks
|
|
31
|
+
still fire, only later. The Pub/Sub app must belong to the same Google Cloud project. No Pub/Sub app yet?
|
|
32
|
+
<a href="/admin/config/oauth/new?provider=gmailService&baseScopes=pubsub" target="_blank"
|
|
33
|
+
rel="noopener" class="link link-animated">Register one</a> in a new tab, then reload this page.</span>
|
|
43
34
|
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{{!-- The scope presets of an API-mode app: each button rewrites the managed entries of the custom
|
|
2
|
+
scope lists at the bottom of the form (updateScopesFromAccountType() in oauth_form.hbs) and leaves any
|
|
3
|
+
other scope there alone.
|
|
4
|
+
Params:
|
|
5
|
+
provider - "gmail" or "outlook", the preset table the buttons use (required) --}}
|
|
6
|
+
<div id="account-type-card-{{provider}}">
|
|
7
|
+
<span class="label-text block mb-2">Scope preset</span>
|
|
8
|
+
<div class="flex flex-wrap gap-2" role="group" aria-label="Scope preset">
|
|
9
|
+
<button type="button" class="btn btn-outline btn-primary btn-sm account-type-btn" data-type="normal"
|
|
10
|
+
data-provider="{{provider}}">Full access</button>
|
|
11
|
+
<button type="button" class="btn btn-outline btn-primary btn-sm account-type-btn"
|
|
12
|
+
data-type="readonly" data-provider="{{provider}}">Read-only</button>
|
|
13
|
+
<button type="button" class="btn btn-outline btn-primary btn-sm account-type-btn"
|
|
14
|
+
data-type="readonlysend" data-provider="{{provider}}">Read-only + send</button>
|
|
15
|
+
<button type="button" class="btn btn-outline btn-primary btn-sm account-type-btn"
|
|
16
|
+
data-type="sendonly" data-provider="{{provider}}">Send-only</button>
|
|
17
|
+
</div>
|
|
18
|
+
<span class="helper-text">Fills in the custom scopes at the bottom of the form, where the exact scopes can
|
|
19
|
+
be reviewed.{{#equals provider "gmail"}} Send-only needs no restricted-scope verification from Google, but
|
|
20
|
+
EmailEngine cannot track what such an account sends.{{/equals}}</span>
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
ui/choice-tab - one option of a ui/choice-tabs strip: a radio input laid over
|
|
3
|
+
a tab, so the whole tab is the input's hit target and the tab looks selected
|
|
4
|
+
while the input is checked.
|
|
5
|
+
Params:
|
|
6
|
+
id - input id (required)
|
|
7
|
+
name - radio group name (required)
|
|
8
|
+
value - submitted value (required)
|
|
9
|
+
label - tab text (required)
|
|
10
|
+
checked - true when selected
|
|
11
|
+
class - extra classes on the input, e.g. a page script hook (optional)
|
|
12
|
+
badgeLabel - short badge after the label, e.g. "Pub/Sub only" (optional)
|
|
13
|
+
badgeId - id of that badge, for a script that shows or hides it (optional)
|
|
14
|
+
badgeHidden - true to render the badge hidden (optional)
|
|
15
|
+
There is no disabled state: the tab styling keys on the label, so a disabled
|
|
16
|
+
checked input would still look selected. Add one before a caller needs it.
|
|
17
|
+
--}}
|
|
18
|
+
<label class="tab relative gap-2 whitespace-nowrap has-checked:tab-active has-focus-visible:outline-2 has-focus-visible:outline-primary has-focus-visible:-outline-offset-2" for="{{id}}">
|
|
19
|
+
<input type="radio" class="absolute inset-0 m-0 cursor-pointer appearance-none opacity-0{{#if class}} {{class}}{{/if}}" id="{{id}}" name="{{name}}"
|
|
20
|
+
value="{{value}}" {{#if checked}}checked {{/if}}/>
|
|
21
|
+
{{label}}
|
|
22
|
+
{{#if badgeLabel}}{{> ui/badge label=badgeLabel variant="neutral" soft=true class=(concat "badge-sm" (when badgeHidden " hidden" "")) elId=badgeId icon="" title="" dataName="" dataValue=""}}{{/if}}
|
|
23
|
+
</label>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
ui/choice-tabs - a radio group drawn as a tab strip, for a form choice whose
|
|
3
|
+
options each reveal their own fields. Block form only; the block holds
|
|
4
|
+
ui/choice-tab items:
|
|
5
|
+
{{#> ui/choice-tabs label="Base scope" heading="What the app connects with" note="Fixed once the app is created"}}
|
|
6
|
+
{{> ui/choice-tab id="scopeImap" name="baseScopes" value="imap" label="IMAP and SMTP" checked=true}}
|
|
7
|
+
{{> ui/choice-tab id="scopeApi" name="baseScopes" value="api" label="Gmail API"}}
|
|
8
|
+
{{/ui/choice-tabs}}
|
|
9
|
+
Unlike ui/tabs (a FlyonUI data-tabs view switcher), the selection is a real
|
|
10
|
+
radio input submitted with the form, so there is no hidden field to keep in
|
|
11
|
+
sync, arrow keys move between options natively and a test can .check() the
|
|
12
|
+
input. Showing the fields of the selected option is the page's job: listen
|
|
13
|
+
for `change` on the radios.
|
|
14
|
+
Params:
|
|
15
|
+
label - aria-label of the group (required)
|
|
16
|
+
heading - visible heading above the strip (optional)
|
|
17
|
+
note - muted note next to the heading, e.g. a constraint (optional)
|
|
18
|
+
elId - element id (optional)
|
|
19
|
+
class - extra classes on the strip (optional)
|
|
20
|
+
--}}
|
|
21
|
+
<div>
|
|
22
|
+
{{#if heading}}
|
|
23
|
+
<div class="flex flex-wrap items-baseline gap-x-2 mb-1">
|
|
24
|
+
<span class="label-text">{{heading}}</span>
|
|
25
|
+
{{#if note}}<span class="text-xs text-base-content/60">{{note}}</span>{{/if}}
|
|
26
|
+
</div>
|
|
27
|
+
{{/if}}
|
|
28
|
+
<div class="tabs tabs-bordered{{#if class}} {{class}}{{/if}}" role="radiogroup" aria-label="{{label}}"{{#if elId}} id="{{elId}}"{{/if}}>
|
|
29
|
+
{{!-- own hash params neutralized against fallthrough into the block --}}
|
|
30
|
+
{{> @partial-block label="" heading="" note="" elId="" class=""}}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
--}}
|
|
23
23
|
<div class="w-full">
|
|
24
24
|
<div class="flex items-center gap-2">
|
|
25
|
-
<input type="radio" class="radio radio-sm{{#if error}} is-invalid{{/if}}{{#if class}} {{class}}{{/if}}" id="{{id}}" name="{{name}}" value="{{value}}"
|
|
25
|
+
<input type="radio" class="peer radio radio-sm{{#if error}} is-invalid{{/if}}{{#if class}} {{class}}{{/if}}" id="{{id}}" name="{{name}}" value="{{value}}"
|
|
26
26
|
{{#if checked}}checked {{else}}{{#equals selected value}}checked {{/equals}}{{/if}}{{#if disabled}}disabled {{/if}}>
|
|
27
|
-
<label class="label-text p-0" for="{{id}}" {{#if labelTitle}}title="{{labelTitle}}" {{/if}}>{{label}}</label>
|
|
27
|
+
<label class="label-text p-0 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed" for="{{id}}" {{#if labelTitle}}title="{{labelTitle}}" {{/if}}>{{label}}</label>
|
|
28
28
|
{{#if tooltip}}
|
|
29
29
|
{{!-- class="" blocks this partial's own class param (meant for the
|
|
30
30
|
input) from falling through onto the tooltip wrapper --}}
|
|
@@ -19,13 +19,14 @@
|
|
|
19
19
|
inputClass - extra classes on the input (optional)
|
|
20
20
|
toggleId - reveal button id (required; used by page scripts/tests)
|
|
21
21
|
toggleLabel - reveal button aria-label (default "Show password")
|
|
22
|
+
required - true to mark the input required (optional)
|
|
22
23
|
--}}
|
|
23
24
|
<div class="join w-full secret-field">
|
|
24
25
|
<input type="password"
|
|
25
26
|
class="input join-item grow or-else-all{{#if inputClass}} {{inputClass}}{{/if}}{{#if error}} is-invalid{{/if}}"
|
|
26
27
|
id="{{id}}" data-target="secret-btns-{{id}}"
|
|
27
28
|
name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" value="{{value}}"
|
|
28
|
-
{{#if placeholder}}placeholder="{{placeholder}}" {{/if}}data-lpignore="true" autocomplete="off" />
|
|
29
|
+
{{#if placeholder}}placeholder="{{placeholder}}" {{/if}}{{#if required}}required {{/if}}data-lpignore="true" autocomplete="off" />
|
|
29
30
|
{{!-- solid primary: matches the attached copy button in ui/copy-field --}}
|
|
30
31
|
<button class="btn btn-primary join-item secret-btns-{{id}}" type="button" id="{{toggleId}}"
|
|
31
32
|
data-toggle-password='{"target": "#{{id}}"}'
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
app.tailwind.css, because the three hand-rolled link navs need it too.
|
|
16
16
|
Panels are the caller's responsibility: each ui/tab target must match a
|
|
17
17
|
tabpanel element with that id (role="tabpanel" aria-labelledby="<target>-tab").
|
|
18
|
-
|
|
19
|
-
they run a custom script instead of the FlyonUI data-tabs plugin.
|
|
18
|
+
For a form choice submitted as a radio, use ui/choice-tabs instead.
|
|
20
19
|
--}}
|
|
21
20
|
<nav class="tabs {{#equals variant 'segment'}}tabs-segment{{else}}tabs-bordered{{/equals}}{{#if class}} {{class}}{{/if}}" aria-label="{{label}}" role="tablist"{{#if elId}} id="{{elId}}"{{/if}} data-tabs>
|
|
22
21
|
{{!-- own hash params neutralized against fallthrough into the block --}}
|