mirror of
https://github.com/mattermost/mattermost.git
synced 2026-11-28 15:38:27 +08:00
master
22
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f5de797495 |
Plugin API: EvaluateAccessControlBatch, CheckAccessControlExpressionForSearch, and ABAC-unavailable Get/Delete fallback (#39895)
* MM: add EvaluateAccessControlBatch and CheckAccessControlExpressionForSearch plugin APIs EvaluateAccessControlBatch builds the subject once and evaluates up to 500 distinct resource IDs for one user, returning decisions keyed by ID; IDs that could not be evaluated are omitted so callers fail closed. When the ABAC engine is unavailable, existence is resolved for the whole batch with one type-filtered SearchPolicies. CheckAccessControlExpressionForSearch exposes the enterprise membership check (lint + session-attribute rejection + CheckSqlizable) so plugins whose policies must also drive user searches can gate saves on it. GetAccessControlPolicy and DeleteAccessControlPolicy now fall back to the raw store when the engine is unavailable, so a plugin can still show and clear its restrictions after a license lapse. Co-authored-by: Joram Wilander <joram@mattermost.com> * Make plugin ABAC batch existence fallback primary-backed and consistent with single-ID path Add AccessControlPolicyStore.GetTypesByIDs (primary read, one query) and use it for the batch existence probe instead of the replica-backed SearchPolicies, so a just-saved restriction cannot be reported as no_policy. Batch evaluator errors now resolve existence per ID like EvaluateAccessControl, document the Get/Delete fallback behavior and the read-only stored form, and extend tests. Co-authored-by: joram <joram@mattermost.com> * docs: document batch evaluation, search expression check and ABAC-unavailable Get/Delete for plugins Co-authored-by: joram <joram@mattermost.com> * Return error from new plugin access control app functions (appErrorReturn vet) Co-authored-by: Joram Wilander <joram@mattermost.com> * Address review: log batch evaluator failures once, clarify batch and fallback docs Co-authored-by: Joram Wilander <joram@mattermost.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> |
||
|
|
01c5cda69b |
MM-71346 Plugin testhelper: run integration tests against an HA cluster (#39403)
* MM-71346 Plugin testhelper: run integration tests against an HA cluster Plugins that use cluster events had no way to test their cross-node behaviour: the testhelper starts a single Mattermost container. - Add SetupCluster(t, n), which starts n nodes forming a real HA cluster. The nodes share one Postgres database, also used as the config store (MM_CONFIG), and one file store volume, so the plugin is deployed once and runs on every node. - Expose the servers as TestHelper.Nodes, each with its cluster ID, hostname, URL, and admin and user clients aimed at it, plus Exec, Pause/Unpause and Stop/Start for fault injection. Setup gets a single node. - Clustering needs a license with the Cluster feature (Mattermost Entry has none). Read it from MM_LICENSE, start the nodes with MM_SERVICEENVIRONMENT=test, skip without a license, and fail when the server rejects it or it lacks the Cluster feature. - Reset the database through the first node with the others stopped, wait for the cluster to form, and wait for the plugin on every node. - Log the tail of each node's container log when a test fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bYRkFZXxqdgiFMsh8MPVm * MM-71346 Tidy server/public go.sum Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bYRkFZXxqdgiFMsh8MPVm * MM-71346 Fix node state tracking in the cluster testhelper - Clear a node's paused flag when it is stopped: Docker stops paused containers, and a stale flag made waitForCluster skip the node after a restart and the Pause cleanup unpause a container that wasn't paused. - Ignore a restarted node's old member while waiting for the cluster, so Start can't return early with the old ID when Docker reuses the address. - Give stopped nodes an empty ID and let paused nodes keep theirs, rather than matching every node by a possibly reused address. - Start the other nodes in parallel after a database reset. - Report which node failed to join when the cluster doesn't form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bYRkFZXxqdgiFMsh8MPVm * MM-71346 Simplify the cluster testhelper - Read whether a node is paused from Docker instead of tracking a flag. - Record a stopped node's cluster ID as stale in Stop, so waitForCluster needs no stale-ID parameter and covers every stop/restart order. - Make Node.Hostname and Node.URL methods reading the container, so Start has nothing to copy. - Key the shared containers by node count; a cluster is more than one node. - Share one inParallel helper for starting and stopping nodes, which also stops the other nodes in parallel on reset and reports every failed start instead of the last. - Drop the admin creation at container start: every Setup resets the database and creates the admin. - Reuse execInContainer for Node.Exec, share the per-node client helper, and poll the cluster status every 250ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bYRkFZXxqdgiFMsh8MPVm * MM-71346 Docs: test a plugin in high availability mode Document testhelper.SetupCluster, the Node fault-injection methods and the MM_LICENSE requirement in the plugin HA guide. * MM-71346 Docs: trim the Node API list in the HA testing section * MM-71346 Fix plugin deploy race and stale node ID in the cluster testhelper deployPlugin removed and re-uploaded the plugin as two separate cluster messages, which receivers handle concurrently, so a node could apply the remove after the install and lose the plugin. A forced upload replaces the existing install in one step. Node.Start now forgets the node's old cluster ID before starting, so a node that stopped other than through Stop doesn't keep a dead ID after rejoining. * MM-71346 Wait for the plugin on each cluster node by ID, and remove the test network on failure deployPlugin now waits until the plugin runs on every current cluster node, matched by ID, rather than on as many nodes as there are. A failed container start also removes the Docker network instead of leaving it to the reaper. Document that Setup and SetupCluster in one test binary run side by side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vpi5iekJF1wHe68kShpjr --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: wiggin77 <wiggin77@warpmail.net> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: mattermost-code <matty-code@mattermost.com> Co-authored-by: maria.nunez <maria.nunez@mattermost.com> |
||
|
|
2cce4231cb |
docs: fix broken internal links and fail CI on new ones (#39953)
* docs: fix broken internal links in developer and product docs Contributor guide linked to root-level /why-contribute, /good-decisions, /expectations and /more-info; switch these and other root-relative or moved-page links to relative file links or current paths. Repoint absolute docs.mattermost.com links that no longer resolve, demote body-level H1s that Docusaurus renders without ids, and fix stale anchors. * docs: register plugin reference anchors with the broken-link checker The generated server/webapp/manifest reference components render raw elements with ids, which Docusaurus does not see, so every deep link into them was reported as a broken anchor. * docs: fail CI on broken links and unresolvable absolute docs links Set onBrokenLinks and onBrokenMarkdownLinks to throw now that the build is clean, keep onBrokenAnchors at warn, and add check:absolute-links to Docs CI to validate absolute https://docs.mattermost.com links against the build. * chore(docs): refresh rendered IME diagram Auto-generated by .github/workflows/docs-ime-render.yml. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
||
|
|
b9eed09fde |
Docs: Update ABAC and property system docs for v12.0 (#39297)
* Docs: Add an access policy expression reference Access rule syntax was spread across several pages and the v12 changelog, and the multiselect, hierarchical, IP range, version and account-age operators and the native user fields weren't documented anywhere. Add one reference page that covers the values a rule can use, every Simple Mode operator and the expression it produces, the full set of operators Advanced Mode accepts, ranked, hierarchical, channel and session attributes, how rules combine, and what happens when a rule can't be evaluated. List it in the attribute-based access control section of the sidebar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Document channel attributes in access rules Channel attributes can be compared with user attributes in membership and permission policy rules, but the docs still described them, and Classification Markings, as informational only. Replace those claims with a section on using channel attributes in access rules: linking the attributes, adding one in the editor, the supported comparisons, and the warning that a channel missing a value denies everyone. Also document the Classification Markings clearance attribute, drop the feature flag instructions for channel attributes, and correct the license badge to Entry or Enterprise Advanced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Update ABAC overview and system-wide policies for v12 Point navigation at the Membership Policies and Permission Policies pages, describe per-channel auto-add and the "Enforce policy immediately" option, and add steps for creating a permission policy. Explain that simulation is available in permission policy editors via Simulate rules, including session attribute overrides. Replace the Simple Mode operator lists with a link to the expression reference, fix the Advanced Mode syntax to user.attributes.<name>, drop instructions for feature flags that are now on by default, align versions (permission policies in v11.7, burn-on-read in v12.1), update the license tier to Entry or Enterprise Advanced, and shorten the team assignment section in favour of the team membership page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Update channel and team-scoped channel policy pages for v12 Team Admins can assign team-level channel membership policies to public as well as private channels, so the team channel policies page now describes both and explains that public channels are advisory. The self-inclusion filter and self-exclusion check only apply when a policy covers a private channel. Auto-add is described as a per-channel setting that isn't inherited from system policies, replacing the old active-state wording. On public channels with auto-add on, a matching user who leaves is added again at the next sync, and both pages now say so. Policy inheritance now says plainly that every applicable policy must allow access. The duplicated Team Settings section on the channel access rules page is replaced with a link, operator lists link to the expression reference, and instructions for feature flags that are on by default are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Fix team membership policy labels and licensing Quote the System Console setting as it appears in the UI ("Allow attribute based access controls on this server") and describe the license as Entry or Enterprise Advanced throughout. Drop the feature flag instructions and the flag on/off table, since team membership policies are on by default. Call the editor Simple Mode, as the UI does, and point the operator lists at the expression reference rather than repeating an incomplete list. Link the sync interval settings and the ABAC setting to the System Attributes settings reference, and align the team settings entry in the user management configuration page with these pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Document hierarchical attributes and attribute sync in Attribute Management Add a Hierarchical attributes section covering how to build the value tree (top-level and child values, multiple parents, moving and deleting values), the create-only type, the parent and depth limits, where values are set, and how the attribute is used in access rules. Correct the licensing badges to Entry, Enterprise, or Enterprise Advanced for the page and Entry or Enterprise Advanced for the Channels resource, drop the feature-flag conditions, and fix the Channels display location choices. Note that AD/LDAP takes precedence when both sources are linked, that hierarchical attributes can't be linked, and point the user-managed attributes link at the System Attributes settings reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Document mmctl user attributes commands The mmctl reference described a top-level `mmctl cpa` command with flags and field types that don't exist. Replace it with the real `mmctl user attributes` command (aliases `attrs` and `cpa`), covering the field list/create/edit/delete and value list/set subcommands with their actual arguments and flags. Explain that from v12.0, field edit and delete fail for attributes linked to Attribute Management, that the underlying User Attributes API is deprecated, and correct the license badge to Entry, Enterprise, or Enterprise Advanced. Point existing links at the new section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Point user attribute links at Attribute Management The User attributes page describes the System Console page from before v12.0, which now redirects to Attribute Management. Retitle it and state plainly that it covers earlier releases only, fix its malformed EnableUserManagedAttributes config example, and use the UI's own "Editable by users" label throughout. Links elsewhere that mean the current feature (zero trust, plans, profile, calls, session attributes, user management, mission partner and Slack migration pages) now go to Attribute Management, and the calls page uses the current "Profile display: Hidden" label. Also fixes a typo on the editions page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Add System Attributes settings reference and ABAC audit events The System attributes page listed features but documented none of the AccessControlSettings. It is now a settings reference: an index of the System Attributes console pages, then one entry per setting with its console label, default, config.json key and environment variable, including the four settings that have no console option. The audit log schema now lists the per-user membership records written by sync jobs when ABAC audit logging is enabled, with their parameters and reason values. The access control events table now describes what each event records today and adds the plugin policy, team policy cleanup and batch auto-add events. User attributes events gain cpaValueChange. Links that pointed at the legacy user attributes page for the user-managed attributes setting now point at the new reference entry, and the team membership page no longer says that an attribute refresh interval of 0 disables refreshing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Document user attribute sync in AD/LDAP and SAML settings The AD/LDAP and SAML settings pages covered only the built-in profile fields, so admins setting up an identity provider couldn't find the User attributes sync section. Add a settings entry for it in both sections, describing how mappings are saved, which attribute types can be synced, how values and options are managed, AD/LDAP precedence, and when each source syncs. Point to it from the AD/LDAP and SAML setup pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Document bot attributes and user attribute values Bot accounts can carry user attribute values from v12.1, so access policies check them like any user. The integrations settings page now explains where to set them, who can, and how they interact with access rules and the user-managed attributes setting. The profile page now covers user attributes from the user's side: where they appear, which values users can change and why some are read-only, how each kind of value is chosen (including the hierarchical picker), and how the profile popover shows them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Correct v12 ABAC and attribute notes in changelog and upgrade guides The v12 release notes pointed integrations at an undefined "Global Attributes API" and never said the User Attributes (Custom Profile Attributes) API is deprecated. Name the Properties API endpoints for user attributes and templates instead, and add a deprecation entry that covers the HTTP 400 on linked fields, the effect on mmctl user attributes field edit and delete, and the planned removal. Also correct the session attributes note (they're available by default but each one starts disabled), drop feature flag conditions for channel attributes that were already on by default, and link the hierarchical functions and channel attributes notes to their reference pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Remove the bot attributes section from integrations settings Setting user attribute values on bot accounts isn't in a released version yet, so the Bot attributes subsection described a feature readers can't use. Remove it until the feature ships. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Limit AD/LDAP and SAML attribute sync notes to current behavior The AD/LDAP, SAML and Attribute Management pages described attribute sync behavior that hasn't shipped in a release: Select and Multiselect attributes keeping their type, sync-managed options and the option limit, clearing values the identity provider stops sending, and AD/LDAP taking precedence over SAML. Remove those notes. Linking an attribute to AD/LDAP or SAML changes it to Text, and an external source can be added only before the attribute applies to a resource, as the Attribute Management page said before. The User attributes sync settings entries, when each source syncs, and the links from Attribute Management are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Remove the burn-on-read permission from permission policy pages Restricting who can send burn-on-read messages with a permission policy isn't in a released version yet; released permission policies cover file upload and file download only. Remove the burn-on-read permission from the system-wide and channel permission policy pages, the ABAC overview, the System Attributes settings and audit log pages, and the end-user burn-on-read section. Burn-on-read messages themselves are still documented, along with the setting that turns them off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Remove hierarchical "has any of" against channel attributes In v12.0, hasAnyOf and hasAllOf need a multiselect user attribute, and Simple Mode doesn't offer a channel attribute for "has any of" or "has all of" on a hierarchical attribute. Hierarchical attributes compare with a channel attribute only through the covers and within operators, so the expression reference and the channel attributes page no longer say otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Limit the permission policy warning to file actions In v12.0, permission policies cover only file upload and file download, so posting a message is never evaluated against them. The warning no longer describes incoming webhooks and custom slash commands, which can't attach files, or plugins posting messages. It also said scheduled messages are evaluated when they're scheduled. In v12.0 nothing is checked at scheduling or at send time: the upload restriction is checked when each file is uploaded, so the warning now says that instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Drop required channel attribute claims from the v12.0 changelog In v12.0, required channel attributes are enforced only when the off-by-default ChannelAttributesRequired feature flag is on. By default the create-channel dialog doesn't ask for channel attributes and the channels API doesn't refuse a channel without a required value, so the channel attributes entry no longer says either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Remove the Managed by indicator from Attribute Management The Users resource settings in v12.0 don't show which external source an attribute is synced from; the Managed by indicator isn't in a released version yet. Linked sources are still listed under Synced with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Restore existing burn-on-read and permission policy text Recent edits removed text about restricting burn-on-read messages with a permission policy, and rewrote the permission policy warning about plugins, webhooks, slash commands and scheduled messages. That text was already in the docs before these edits, so put it back as it was: the burn-on-read permission and the setting it works with on the system-wide policies page, the warning, the burn-on-read mentions on the ABAC overview and channel access rules pages, and the end-user burn-on-read section. Label, version and typo fixes made to those pages since are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Restore existing attribute sync notes in Attribute Management Recent edits removed or reworded notes in the Link an attribute to AD/LDAP or SAML section that were already in the docs: Select and Multiselect attributes keeping their type, sync-managed options, which types keep their type when linked, the Managed by indicator, and values cleared when the identity provider stops sending them. The note that an attribute linked to an external source doesn't need options was removed too. Put that text back as it was. The correction that Ranked attributes change to Text and Hierarchical attributes can't be linked is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Restore required channel attribute notes in the v12 changelog The channel attributes entry in the v12.0 release notes said that users are asked for required channel attributes when creating a channel, and that the channels API refuses a channel missing a required value. Those sentences were in the release notes before recent edits removed them, so put them back. The entry's licensing wording is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * API docs: Correct access control policy schemas The access control policy schema described fields the server never had (display_name, description, a policy-level expression, is_active, update_at, delete_at). It now matches the policy model: type, version, roles, imports, scope and a rules array, with each rule's role, actions, expression and auto_add metadata. The deprecated active field is marked as such. Also fix the related schemas: list and test responses return total, the policy search accepts auto_add, actions, team_id and scope, the expression error has no field property, the expression test and visual AST requests take teamId, and the visual AST condition's value_type is an integer with an attribute_type. Simulation results gain the missing blame sources, merged_rules, the evaluation tree node and the session id; use_active_session is marked as ignored. The Action Search schemas list the supported resource type, actions and denial reason. The fields autocomplete endpoint returns an array of property fields, so its unused response schema is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * API docs: Document delegated access control permissions and parameters The access control routes said "requires manage_system" almost everywhere, but team admins and channel admins can call most of them through team_id, teamId and channelId, which weren't documented either. Each route now lists the permissions its handler checks and the parameters it reads, with the minimum server version. Also corrects several responses and conditions: the batch activate endpoint returns an array and sets auto-add, the deprecated single activate endpoint rejects cookie sessions, the channel attributes response is a map of value arrays and is empty when channel access indicators are off, the team policy response includes parent_policies, policy search and simulation describe when they return 501, and Action Search describes its real permission check and supported actions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * API docs: Document property field option routes and v12 property types Add the property field options endpoints (list, create, update, delete) with their option and page schemas, so large and hierarchical option sets can be read and edited one option at a time. Add the rank and graph field types, the session and system object types, how fields with more than 1000 options are returned, and the value shape for each field type. Note per-route minimum server versions, license requirements, permissions, the value patch limits and the access control group field limits, and correct the delta sync boundary on the value routes, which is inclusive. Document property_values on channel creation, which sets channel attribute values when the channel is created. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * API docs: Deprecate custom profile attribute endpoints and fix their schemas Mark every custom profile attributes endpoint as deprecated since v12.0, pointing each one at its Properties API replacement. Document the 400 that field patch and delete return for fields linked to a global attribute template, and how to create a linked attribute instead. Fix the value shapes: the values endpoints take and return a map from field ID to value (at most 50 entries), and listing a user's values returns a map too; its response schema was also detached by its indentation. Add the rank and graph field types, option rank and parents, the managed attribute, the omitted-options markers, the license requirement and the permission for setting another user's values. Declare the access control, properties, custom profile attributes and permissions tags, so each gets a description and its own page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Plugin API docs: Correct minimum versions and document access control methods The plugin access control methods first shipped in 11.11, the property field option methods in 12.0, and HasPermissionToFileAction in 12.0 (with backports to 11.7.12, 11.10.3 and 11.11.1), so their minimum server version tags now say so. The godoc also now describes what plugin authors need to call these methods correctly: the access_control group and the refused custom_profile_attributes name, required field properties and field types, value shapes per type, the no-policy decision and fail-closed errors, plugin policy validation rules, what actingUserID is used for, and a link to the access policy expression reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Add developer guides for the property system and plugin access control Plugin authors had only the generated SDK reference for the property system and attribute-based access control. Add two server plugin guides: one on groups, fields, values, templates, options and the property websocket events, with plugin API examples; and one on protecting plugin-owned resources with access policies, checking decisions safely, reusing the System Console rule editors in a web app plugin, and respecting file upload and download policies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Reorganize attribute-based access control navigation List the attribute-based access control pages in task order: define user, channel and session attributes first, then system-wide, team and channel policies, then the expression reference, with the page for the User Attributes screen of releases before v12.0 last. The sidebar comment now explains that order. Also tidy a few pages found while checking the section: - The ABAC overview links to the System Attributes settings reference. - The session attributes operator table links to the expression reference. - The legacy User attributes page shows the Entry, Enterprise and Enterprise Advanced badge, matching its license gate. - The channel and team channel policy pages describe the attribute refresh interval as the delay before searches and rule tests see an attribute change, rather than a fixed refresh schedule. - The server plugins overview links to the property system and plugin access control guides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Leave the v12 changelog and plugin API comments unchanged Keep this change to the documentation pages and the REST API reference. The v12 changelog and the plugin API comments go back to their current text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Leave the important upgrade notes unchanged Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Leave the deprecated features page unchanged Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Mark custom property groups as deprecated Tell plugin developers to put new attributes in a built-in group, and that fields used in access control decisions must be in the access_control group. Plugin-registered groups belong to version 1 of the property system and are now described as deprecated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Address CodeRabbit review on ABAC and property docs Align OpenAPI responses and tag text with existing endpoint docs, fix a repeated word, list the missing permission in the policy steps, and nest mmctl user attributes under mmctl user. Co-authored-by: mattermost-code <matty-code@mattermost.com> * Docs: Name the action decisions endpoint in the access control tag Co-authored-by: mattermost-code <matty-code@mattermost.com> * Docs: Address remaining CodeRabbit notes on ABAC and CPA docs Document inherited auto-add, async policy sync, JSON null value clearing, the 401 on PatchCPAValuesForUser, and which pre-v12 attributes are not linked. Co-authored-by: mattermost-code <matty-code@mattermost.com> * Docs: Address review feedback and trim API descriptions Shorten the API descriptions this branch added. License requirements are stated once in the properties and custom profile attributes tag descriptions instead of on every endpoint, error conditions move into the description of the response they produce, and operation descriptions keep what a caller needs to make the request. Document attrs.display_name and the access_control naming rules on PropertyField, with the matching 422 on field create and patch. Clarify which fields channel creation accepts in property_values. On the end-user banners page, say that markings don't control access on their own and that from v12.0 an access rule can restrict a channel by classification. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Fix CPA list replacement route and discovery-mode wording The Properties API returns 400 for a user field list without a scope, so the replacement for listing custom profile attribute fields now includes target_type=system. The action decisions request schema now says that an empty or omitted actions list both select discovery mode, matching the endpoint description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Generalize permission policies and drop window editor guidance Describe file upload and download as one example of permission policies, clarify that the policy editor methods run in the plugin's server, and remove the section on the rule editors exported on window.Components, which the web app marks as internal plugin use only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: Address review feedback on ABAC docs - Remove EnableUserManagedAttributes documentation - Drop mid-page license notes covered by the plan label - Describe channel permission rules generically instead of listing actions - Clarify that OR-combined rules apply to channel permission rules Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: mattermost-code <matty-code@mattermost.com> |
||
|
|
e8c7307f42 |
Restrict unauthenticated webapp plugin manifests to pre-auth plugins (#39433)
* Add pre_auth webapp manifest flag and RestrictUnauthenticatedWebappPlugins setting
Unauthenticated GET /api/v4/plugins/webapp now only returns plugins whose
manifest sets webapp.pre_auth, with a trimmed manifest, when the new
PluginSettings.RestrictUnauthenticatedWebappPlugins setting is enabled. The
setting defaults to true for new installations and is turned off by a one-time
migration on existing installations.
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Add server tests for pre-auth webapp plugin filtering
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Load remaining webapp plugins after login and add admin console toggle
The login page may only receive pre-auth plugins, so performLogin now awaits a
plugin re-sync before callers navigate, and LoggedIn re-syncs as a fallback
when the plugin list was last fetched for a different session.
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Add webapp tests for post-login plugin re-sync
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Add Playwright E2E coverage for pre-auth webapp plugins
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Add system console E2E spec for the RestrictUnauthenticatedWebappPlugins toggle
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Add upgrade E2E check that existing installs keep unauthenticated webapp plugins
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Fix err shadowing lint failure in TestGetWebappPluginsUnauthenticated
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Only record the plugin fetch session after a successful fetch
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Document RestrictUnauthenticatedWebappPlugins and webapp.pre_auth
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Note that pre-auth webapp plugin filtering is available from v12.2
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Reword pre_auth version note in OpenAPI schema
Co-authored-by: Joram Wilander <joram@mattermost.com>
* Revert "Reword pre_auth version note in OpenAPI schema"
This reverts commit
|
||
|
|
2b3fb21fe3 |
Add KVListWithOptions for server-side prefix filtering in plugin KV store (#35441)
* Add KVListWithOptions to push prefix filtering into SQL Add server-side prefix filtering for plugin KV store key listing via KVListWithOptions across the full stack: store interface, SQL implementation, platform service, app layer, plugin API, pluginapi helper, and memory store. Previously, WithPrefix in pluginapi.ListKeys performed client-side filtering after fetching all keys. This pushes the LIKE filter into the SQL query for efficiency, using sanitizeSearchTerm to escape SQL wildcards. * Add KVListWithOptions backward-compat fallback for old servers Manually implement the KVListWithOptions RPC glue instead of generating it so the client can detect "rpc: can't find method" errors from pre-11.5 servers and return a proper AppError with StatusNotImplemented. The generated version silently returns (nil, nil) on RPC errors, which is indistinguishable from an empty result due to encoding/gob conflating nil and empty slices. The pluginapi helper already checks for StatusNotImplemented and falls back to KVList with client-side prefix filtering. * Address review findings on KVListWithOptions - Escape backslashes in the SQL prefix instead of stripping them. - Return an AppError for every RPC failure in the KVListWithOptions client. - AND multiple WithPrefix options again; extra prefixes become checkers. - Make the old-server fallback page over prefix-filtered keys and trigger only on StatusNotImplemented. - Set the minimum server version to 12.2 and fix the WithChecker doc. - Remove the unused PlatformService.KVListWithOptions. - Route List and ListPluginKeys through their WithOptions variants. * Tighten KV list tests from CodeRabbit nitpicks - Assert exact keys per page in the prefix pagination store test. - Drop unused pgHost/pgPort lookups in the KV integration test. - Include compiler output in the plugin build failure message. * Use snake_case mlog field key in ListPluginKeysWithOptions * Move KVListWithOptions integration tests into regular test suites - Cover the plugin-to-SQL path with a test_kv_list_with_options plugin run by TestBasicAPIPlugins. - Cover the old-server RPC error mapping with a unit test against an RPC server that lacks the method. - Remove server/integration/pluginapi and the testcontainers dependency it pulled into server/go.mod. * Combine WithPrefix prefixes so all prefix filtering stays server-side A second prefix ran as a checker after page and count were applied, so pages came back short. Nested prefixes now collapse to the longest one, and prefixes that cannot both match return no keys. * Use a fixed batch size for the ListKeys prefix fallback scan The scan read the caller's count keys per KVList call, so a small count made many RPCs. It now reads 1000 keys per call, independent of count. * Use an explicit ESCAPE '*' for the plugin KV prefix LIKE Matches the other LIKE queries in the store and does not depend on the default backslash escape of Postgres. * Rename the KVListWithOptions RPC error ids to plugin.api.kv_list_with_options.* Matches the naming of the other plugin API error ids. * Add a benchmark for listing plugin keys with a prefix Compares paging through KVList and filtering in Go with KVListWithOptions, for 10k, 100k and 1M keys. * Document KVListWithOptions and prefix listing for plugins Expands the doc comments that generate the server plugin reference, and adds a best-practices section on listing KV store keys with a prefix. |
||
|
|
a8f8a6b523 | Documentation updates for some missed areas. (#39511) | ||
|
|
1ac3eb8c28 |
docs: AI draft for MM-71344 Plugin API: expose cluster node identity (#39401)
Co-authored-by: mattermost-docs-ai[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
||
|
|
79e7448565 |
Lay dialog elements out as a grid, and let a dialog pick its width (#39082)
* Lay dialog elements out as a grid, and let a dialog pick its width
An Interactive Dialog could already group elements under a heading with a
collapsible container, but it could only stack them vertically. A form
asking for the same handful of fields across several records — a status
per service, a quantity per line item — therefore read as one labelled
block per record, repeating every label, with nothing lining up.
Two changes, both additive.
A grid layout mode
------------------
Setting SubType "grid" on a collapsible lays its children out as a table
rather than stacking them: each child container becomes a row, and that
row's children become its cells. This is a layout over ordinary elements,
not a new element type, which is what keeps it cheap:
- a cell is a real element, so Type, SubType, Default, Optional and
MaxLength all work per cell with no new plumbing
- a cell's value arrives in the submission as an ordinary top-level
field, because collapsible children already flatten that way
- an error returned for a cell lands under that one cell, because the
Errors map is already keyed by element name
So neither the submission model nor the error model changes. The webapp
carries the subtype into CollapsibleConfig.layout, and AppsFormGrid
renders the subtree.
The layout rules worth knowing: column headers come from the first row, a
short row is padded on the right rather than shifted, the first element
of each row is a sticky, still-editable row header, and each cell's label
is hidden visually but kept for assistive technology. A child of the
container that is not itself a container cannot be a row, so it renders
under the table rather than being dropped.
A width tier on the dialog
--------------------------
A grid rarely fits in 600px, which is what every dialog has been. Nothing
ever enforced that width: the apps form renders a react-bootstrap Modal
with no size prop, so it inherited Bootstrap's default, and
dialogClassName was hardcoded to classes that set no width at all.
Dialog.Size takes small, medium or large. Empty means small, so no
existing dialog changes — and an unset size adds no class at all rather
than an explicit small one, so the rendered markup is also unchanged.
Tiers rather than pixels keep it themeable and stop an integration asking
for 2000px; .modal-dialog's max-width still applies, so every tier
shrinks on a narrow viewport instead of overflowing. medium reuses the
existing modal-lg rather than widening it, because Mattermost
deliberately narrows Bootstrap's 900px modal-lg to 700px and other
consumers depend on that.
Width sits on the dialog rather than in server config because the
integration is the party that knows how much content the form holds; one
global width cannot suit both a two-field confirmation and a nine-column
grid. Because a refresh response replaces the contents of the open
dialog, returning a different size resizes it in place.
Tests and docs
--------------
Unit tests cover the grid's layout rules, the subtype-to-layout mapping
(including an unrecognised subtype falling back to stacked), size
surviving each hop from the server response to the modal class, and
Dialog.Size validation including that size is omitted from the JSON when
unset.
The Cypress spec drives the webhook server, which gains a grid dialog in
its own module. It covers the table structure, the editable sticky row
header, adding a row in place with typed values preserved, an error
landing on the one offending cell, the width tier resizing the open modal
without losing input, and a button cell opening a child dialog for its
row.
Collapsible elements were never documented, and the grid is a layout mode
on that container, so both are documented here, along with dialog width.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Keep the grid spec's weight cell on whole numbers
MM-T5700D typed 12.5 into the weight cell and asserted it survived the
refresh. It did not: the assertion got 12, and the spec was the one
failing unit in cypress-full-enterprise.
The grid is not at fault. The weight cell is subtype "number", which
renders an <input type="number">, and TextSetting reports those through
parseInt rather than parseFloat:
props.onChange(props.id, parseInt(event.target.value, 10));
so 12.5 becomes 12 before it reaches the submission at all. The webhook
server folds values back with String(...).trim() and coerces nothing, so
the fraction was already gone by the time the state round tripped. That
parseInt predates this branch by two years and lives in a file this
branch does not touch, so fixing it belongs in its own change: it would
alter the value type every number setting in the app emits, the system
console among them.
The test's subject is that half-finished input survives a refresh, and a
whole number demonstrates that just as well. The weight placeholder drops
from "0.0" to "0" for the same reason, since advertising decimals the
field discards is worse than not offering them.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Stop the grid dropping cells, and tighten two loose edges
Three fixes from a review pass over the grid, none of which change how a
well-formed grid renders.
A row longer than the first kept its cells
------------------------------------------
Column count came from the first row, and the body iterated those columns,
so a cell beyond that width was never rendered. That was deliberate and
tested, but the consequence was not: flattenFields recurses into every
collapsible child regardless of layout, and the submit check runs over all
of them, so a required cell in an over-long row was validated while having
no input on screen. The result was a dialog that would not submit and could
not say why, because the error had nowhere to render.
The table is now as wide as the widest row. A heading for a widened column
comes from the first row that has a cell in that position, and a short row
is still padded on the right rather than shifted. For a grid whose rows all
match, which is what the docs ask for, this is exactly the old behaviour.
Keying the headers on the cell name rather than the label also stops two
columns that share a label from colliding, and drops the two array-index
key warnings the file used to produce.
The width transition applied to nearly every modal
--------------------------------------------------
The resize easing was scoped to .modal-dialog.a11y__modal, a class carried
by about a hundred modals across the app, so all of them picked up a width
transition from a form they have nothing to do with. The dialog now carries
an apps-form-modal class and the transition hangs off that instead.
An unknown collapsible subtype passed the server
------------------------------------------------
Dialog.Size rejects anything outside its three tiers, but a collapsible's
SubType was not checked at all, so "gird" validated cleanly, reached the
client and silently rendered as stacked. validateCollapsible now rejects
any subtype other than "grid". It lives there rather than in isValid's type
switch because nesting recurses into validateCollapsible directly to keep
depth tracking and never passes back through that switch, so a nested
container would otherwise be missed.
This is safe to tighten: collapsible appears only in v12.0.0-rc1 and rc2
and has never been in a GA release, so no shipped integration can be
relying on a subtype that was previously ignored.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Give the dialog width section a sequential heading level
The version note under "Dialog width" was an h5 directly beneath an h2,
a three-level jump that trips markdownlint's heading-increment rule and
gives the page a heading outline with two levels missing from it.
It is now an h3, which is the correct next level.
The file has four other heading jumps of the same shape, all under the
11.1 sections and all predating this branch, so they are left alone.
That does mean this section's version note now renders one size larger
than the equivalent note in the neighbouring "Multi-step dialogs" and
"Dynamic field refresh" sections, which are still h5 under an h2.
Making the whole file consistent is a docs change in its own right
rather than something to smuggle into a feature branch.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Address review: keep the slide, keep the section, say what the server does
Every apps form lost its slide-in animation. Bootstrap's `transition:
transform 0.3s ease-out` sits on `.modal.fade .modal-dialog`, exactly as
specific as the new `.modal .modal-dialog.apps-form-modal` rule and earlier
in the cascade, so naming only `width` replaced it rather than adding to it
— and every apps form carries the class, not just a grid. Both transitions
are listed now.
The three width tiers were the same width between 768px and 991px, because
`medium` borrowed `.modal-lg`, whose 700px Mattermost sets app-wide only
above 992px. Both wide tiers get a class of their own and start at
Bootstrap's own 768px breakpoint, so a dialog's width no longer moves when
an unrelated rule does, and the tiers differ wherever a dialog is not
already fluid.
A grid container was rendering its own subtree, which dropped the three
things a collapsible says about itself: `collapsed`, `borderless` and
`display_name` were all ignored, including in the docs' own grid example.
The grid now lays out inside the same CollapsibleSection the stacked layout
uses, so only the arrangement of the children differs.
Accessibility and ragged input, in the grid itself:
- the table takes the container's name through a clipped `<caption>`, and
each row keeps its `display_name` as the row's accessible name
- a required cell's marker was only in the clipped per-cell label, so the
cell looked optional until submission failed; the column heading carries
it too
- rows that are all empty fell through to an empty table instead of the
fallback
- two cells sharing a name in one row collided on their React key and cost
the row a cell; the keys carry the column index
- the sticky first column could cover the cell that just took focus while
tabbing sideways (`scroll-padding-inline-start`)
The docs and a Go comment said an unrecognised `size` or collapsible
subtype was rejected when the dialog opens. It is not:
App.OpenInteractiveDialog logs what IsValid returns and opens the dialog
anyway, and the client falls back to the default width and to a stacked
layout. Both now say that, and tests pin it on the open-dialog path rather
than only on Dialog and DialogElement in isolation. `12.0` in the two new
sections is `12.1`: v12.0.0 is tagged and has neither feature.
Cells are matched to columns by position, so a row that omits an element in
the middle shifts the rest left under the wrong heading. The docs claimed a
mismatch always showed as a gap; they now say what actually happens and
what to do about it.
Also: the grid spec measured nothing it claimed to — `overflow-x: auto` is
set unconditionally, and the width check only read a class name. It now
measures the modal at each tier, checks the sticky column by scrolling the
table, checks the clip on the per-cell labels rather than `not.be.visible`
(which passes for a clipped element either way), waits on
`cy.intercept`/`cy.wait` like action_button_spec rather than on fixed
delays, and covers a window too narrow for the tier. The MM-T5700A–H IDs
were invented and are gone; 942 specs in the repo carry no TestRail ID.
Jest gains the gaps: required cells and per-cell errors, a collapsed grid,
a grid nested in a grid through AppsForm, unique keys, an unknown size, and
the router and adapter hops that carry `size`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Tell the truth about a required cell and about what a refresh keeps
Two from CodeRabbit, both real.
A column heading carried the required marker of whichever row happened to
supply the heading. If the first row's cell was optional and a later row's was
not, the heading stayed unmarked and the later cell looked optional, because
its own label is clipped. A heading speaks for the whole column, so it is now
marked only when every cell in that column is required; when rows disagree the
marker moves to the cells that actually carry it, hidden from assistive
technology since each cell's clipped label already says so.
The dialog width section promised that "values the user has already entered are
preserved as usual" across a refresh. getDerivedStateFromProps merges the
replacement form's initial values over the current ones, so a field that comes
back without its value echoed as `default` is cleared. The grid section already
said to echo them; the width section now says so too.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Point the sticky test at a window the grid actually overflows
Both of the spec's scroll assertions were false, which is how a real assertion
differs from the `overflow-x: auto` check it replaced: that one passed because
the stylesheet sets it unconditionally.
The sample grid is four columns and squeezes to about 500px. Every width tier
on a desktop window leaves more room than that -- 510px inside the 600px tier,
610 inside 700, 810 inside 900 -- so the table always fits and never scrolls.
The sticky test now narrows the window below that floor, where there is
genuinely something for the row header to stay put against, and the width test
no longer claims the grid fails to fit at the narrow tier, because it does fit.
Verified against a local server built from this branch: 9 passing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Say what a refresh actually does to an unechoed field
Not every field type is cleared: initFormValues falls back to `field.value ||
defaultValue`, which is empty for an ordinary field but `false` for a `bool`
and the current time for a required `datetime`. "Will clear" overstated it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Drop the blank line left behind by the removed assertion
Taking the overflow assertion out of the width test left its block padded,
which @stylistic/padded-blocks rejects.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Re-run CI
Empty commit. playwright-full failed on
|
||
|
|
d0d6f36df1 | Docs: Increase interactive dialog title max length to 80 (#39278) | ||
|
|
e7e0ee99d2 |
Docs: interactive dialog checkbox elements and per-channel join/leave messages (#39260)
* update documentation for checkbox group/matrix and join/leave channel settings * update docs from coderabbit review |
||
|
|
bf379803cf |
docs: replace animated GIF docs with H.264 Video (#39009)
* docs: encode animated GIFs to H.264 and drop unused duplicates Add a reproducible ffmpeg encode pipeline and commit 64 MP4s next to their GIF sources. Delete the unreferenced poll.gif pair and the two orphan interactive_message.gif copies. Page rewrites wait on the Video MDX component. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: stop tracking encode-gif-video bytecode Co-authored-by: Cursor <cursoragent@cursor.com> * docs: re-encode GIF videos when the manifest CRF changes Skip was ignoring CRF, so a quality-pass patch was a no-op without --force. Record the CRF that produced each MP4 and treat a mismatch as stale. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: address CodeRabbit findings on gif encode verify/review Verify committed MP4 digests and accept --only; crop GIF refs for review SSIM; guard the encode idempotency test before writing. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: drop the one-shot GIF encode pipeline from the repo The MP4s are the committed product. We do not expect more GIFs, so the encoder, manifest, and tests are throwaway rather than a maintained pipeline. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: add Video MDX component and postbuild markup check Silent H.264 screen captures replace animated GIFs; no autoplay or poster. Authored form wraps src in useBaseUrl so check:base-url-attrs stays clean. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: replace animated GIF references with Video and drop source GIFs Rewrite 63 media refs to <Video> with carried-over alt text and ffprobe aspect ratios; delete the 62 converted GIFs under static/images. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: parse unquoted attributes in check-video-markup Docusaurus emits unquoted HTML attrs when values have no spaces; the postbuild guard must accept that form or every video fails the scan. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: fix Video reduced-motion SSR loop and stray alt prefix Default loop to false until hydration so reduced-motion users never get a looping attribute before JS runs; drop the accidental "alt:" prefix from customize-your-channel-sidebar Video alt text. Co-authored-by: Cursor <cursoragent@cursor.com> * Trim leading white frames from message-formatting-toolbar video The clip opened on a blank frame, so the player showed white until playback started. Cut from the first content frame instead of adding posters. Co-authored-by: Cursor <cursoragent@cursor.com> * Cut message-formatting-toolbar after fade-in completes 0.15s still landed on a washed-out frame; start at 0.3s where the UI is full contrast for the player preview. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
c57df45d9c |
docs: self-host fonts, images, and OpenAPI icons; block build egress (#39092)
* docs: self-host fonts, images, and OpenAPI icons; block build egress Stop hotlinking GitHub/user-images and Google Fonts on the docs site, replace embedded video iframes with links, and fail CI when a build would fetch off-origin resources (closed allowlist for the security-updates feed). Co-authored-by: Cursor <cursoragent@cursor.com> * docs: address CodeRabbit egress review findings Scan an offline (no-Algolia) rebuild in Docs CI, tighten ATTR/getAttr boundaries, flag remote template-literal prefixes before ${, and add alt text for the self-hosted plugin-management image. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: replace egress fixture tree with in-memory unit tests Keep scanner coverage without committing dozens of tiny HTML/CSS/JS fixture files. scanSources takes string maps; CLI smoke uses a temp dir. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: keep YouTube/Wistia embeds on hosted site Restore in-page players for the public docs. Allowlist those hosts in check-egress; the offline packager strips them for airgap. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: simplify hosted-embed allowlist to base domains Co-authored-by: Cursor <cursoragent@cursor.com> * docs: tighten hosted-embed allowlist to player kinds and paths Only iframe/script/img player URLs pass; fetch() and other loads to YouTube/Wistia hosts still fail egress. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: allow Wistia swatch preload in hosted-embed egress check The organize-conversations embed emits link[rel=preload] for the swatch; kind-scoped allowlisting missed it and failed Docs CI. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: use getAttr boundary for script hasSrc check \b matches inside data-src, so the old hasSrc could skip scanning an inline script body. Align with ATTR/getAttr and cover the case in tests. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
9e386cb993 |
docs: resolve raw HTML link and image paths through useBaseUrl (#38958)
* docs: resolve raw HTML link and image paths through useBaseUrl
Docusaurus prepends `baseUrl` to markdown-syntax links (`[text](/path)`) but
never to site-absolute paths written in raw HTML/JSX attributes. Those values
ship verbatim, which is correct only while `baseUrl` is `/`.
Convert the 221 raw `<a href="/...">` anchors across 22 files under docs/main
and the 3 raw `<img src="/img/...">` tags in docs/develop to
`useBaseUrl('/...')`, matching how images in the same table rows already
resolve their paths. Link targets, link text and table structure are unchanged.
Add scripts/check-base-url-attrs.mjs and run it as the first step of
`prebuild` so the build fails fast on any new occurrence.
* docs(site): match CommonMark fence closing in baseUrl attr check
Toggle on any fence-like line could exit a block early; track the
opening marker and only close with the same character of sufficient length.
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs(site): also flag JSX string-literal href/src in baseUrl check
Quoted attributes alone miss href={"/path"} / src={'/path'}, which
bypass baseUrl the same way. Scan both forms through one validation path.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
|
||
|
|
e97df5b6e1 |
[MM-70687] Expose host JSX runtimes to web app plugins (#38489)
* chore(webapp): upgrade to React 19
Bump react, react-dom and react-is to 19.2.8 across the webapp
workspaces along with their @types packages, and upgrade the React
ecosystem packages that needed newer releases to support React 19:
- @mui/material, @mui/base and @mui/styled-engine-sc
- @floating-ui/react
- react-day-picker
- @types/react-transition-group, @types/styled-components
Replace the unmaintained react-beautiful-dnd with its actively
maintained fork @hello-pangea/dnd, which is API compatible, ships its
own types and supports React 19. This drops both the
@types/react-beautiful-dnd dependency and the local patch that forced
react-redux 9 compatibility.
React 19 removes the legacy ReactDOM.render entry point, so the app now
always mounts through createRoot and the webapp side of the
EnableConcurrentReact feature flag is gone.
Apply the types-react-codemod scoped-jsx and
react-element-default-any-props presets to account for React 19 removing
the global JSX namespace and defaulting ReactElement props to unknown,
plus the manual type fixes those changes surfaced.
Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com>
* chore(webapp): pin react at the workspace root so a single copy resolves
With react bumped to 19 only inside the workspaces, npm kept an older
react at the hoisted root to satisfy the peer requirements of packages
such as react-intl, leaving the app with two React copies. Declare react,
react-dom and their types at the webapp root the same way react-intl is
already declared, which is the existing pattern for singleton packages
shared across workspaces, and regenerate the lockfile.
Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com>
* fix(webapp): read a tooltip child's ref from its props
React 19 moved ref into props and made element.ref throw a deprecation error on
access. Read children.props.ref instead, and apply the merged ref after spreading
the child's props so the child's own ref no longer overwrites it.
Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com>
* chore(webapp): resolve a single react-is that matches React 19
react-is 18 does not recognize React 19's react.transitional.element symbol,
so every consumer that inspects elements through it - pretty-format's snapshot
serializer and styled-components among them - silently failed its checks.
Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com>
* test(webapp): expect no legacy context argument on component calls
React 19 drops legacy context, so it now hands function components undefined
as the second argument instead of an empty context object.
Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com>
* test(webapp): re-record snapshots for React 19 and dependency updates
The recorded output changes because React 19 keeps ref in props and omits an
empty value attribute, @hello-pangea/dnd uses data-rfd-* in place of
data-rbd-*, styled-components and MUI generate different class hashes, and the
image asset mock no longer resolves to an empty string.
Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com>
* fix(webapp): keep createRoot available to plugins on window.ReactDOM
React 19 serves createRoot and hydrateRoot only from react-dom/client. Plugins
are built against React 18 and reach them through react-dom's root entry, which
react-dom 18's client.js re-exports from, so every plugin that mounts its own
root got undefined instead of a function. Because a plugin's initialize call is
not guarded, the throw took the whole web app down with it: with plugins enabled
nothing rendered at all, which failed essentially the entire e2e suite.
Exposing react-dom and react-dom/client as one object keeps both surfaces
available to plugins built against either version.
Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com>
* test(e2e): wait for lazy views to mount instead of racing them
React 19 throttles revealing a Suspense boundary's content for ~300ms once a
fallback has been shown, so the first navigation to a lazily-loaded chunk
commits later than it did on React 18. Two specs sampled state within that
window:
- last_viewed_spec asserted on the team's last viewed type immediately after
clicking Threads, but that is recorded when GlobalThreads mounts. Wait for
the view instead, which is the condition the assertion depends on.
- channel_name_tooltips_spec reached the direct message search box via
cy.focused(), which resolved to the button that opened the modal before
focus moved into it. Select the input directly, as every other spec does.
Both specs pass on React 18 and React 19 with these changes.
Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com>
* fix(threads): guard clear() so it cannot undo a later navigation
useThreadRouting's clear() unconditionally replaced the URL with the threads
route of the team captured when the callback was created. GlobalThreads calls it
from an effect that fires once its threads finish loading, so a navigation that
landed between the render and that effect flush was silently undone.
React 19 makes this reachable in practice: its Suspense fallback-reveal throttle
delays the lazily loaded threads view by ~300ms, widening the window enough that
switching teams right after opening Threads bounced back to the previous team.
The test file moves to .tsx so it can render the hook inside a route match.
Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com>
* fix(webapp): preserve live history and React 18 plugin compatibility
* DO NOT MERGE: run React 19 StrictMode E2E discovery
Port Jesse Hallam's discovery tooling from #38235 onto the React 19
upgrade, adapting the development runtime loader and warning detector.
Force StrictMode and E2E exception detection on for this experiment.
Keep NODE_ENV=production outside React and preserve component names.
Both E2E self-tests require instrumentation in discovery mode and use a
React 19 warning. Local Playwright and Cypress self-tests, 13 diagnostic
unit tests, the production build, webapp style/types, and Playwright
checks pass. Cypress lint passes; its typecheck reports errors in
unchanged bot-account and collapsed-thread specs.
Revert this entire commit after collecting the full CI/E2E results.
* Revert "DO NOT MERGE: run React 19 StrictMode E2E discovery"
This reverts commit
|
||
|
|
afc8def801 |
[MM-70573] Propagate context through plugin HTTP (#38354)
* add context-aware plugin requests; tests * improve comments * fix PluginHTTP stream cleanup * close unexpected PluginHTTP test response * synchronize plugin response writer shutdown * linting * address context-aware plugin HTTP review feedback --------- Co-authored-by: Mattermost Build <build@mattermost.com> |
||
|
|
b9c2bd733f |
docs: restore generated plugin SDK reference pages (#37788)
* docs: restore generated plugin SDK reference pages Reimplements the Hugo-era plugingodocs/pluginjsdocs/pluginmanifestdocs shortcode pipeline natively in Docusaurus, so the server plugin SDK, web app plugin SDK, and manifest reference pages render full generated content again instead of "Generated content (migrating)" placeholders. Two new Go generators (gen-plugin-godocs, gen-plugin-manifest-docs) and one Node generator (gen-plugin-jsdocs.mjs) read server/public/plugin, server/public/model, and webapp/channels/src/plugins/registry.ts directly from this monorepo and emit gitignored JSON consumed by new PluginGoDocs/PluginGoExample/PluginJsDocs/PluginManifestDocs React components, wired into prestart/prebuild alongside the existing sidebar/OpenAPI generators. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: remove migration plan doc from this PR Was a handoff/status doc for the implementing agent, not meant to ship as part of the change itself. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: make plugin-godocs/manifest-docs builds atomic build:plugin-godocs and build:plugin-manifest-docs redirected straight into data/plugin-*.json, which doesn't exist on a clean checkout (the redirection itself would fail before the generator ever ran) and, on a subsequent failed run, would truncate a previously-good JSON file before failing. Create data/ up front, write to a .tmp file, and only mv it into place once the generator exits successfully. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: fix review findings in plugin doc generators gen-plugin-manifest-docs: - jsonFieldName now excludes unexported fields (matching encoding/json) and falls back to the Go field name when there's no tag or the tag's name component is empty (e.g. json:",omitempty"), instead of dropping the field entirely. - exprTypeDocs's SelectorExpr case now resolves a qualified type only when its package qualifier actually points at the model package (checked against the declaring file's imports), instead of matching any x.Sel identifier by name alone regardless of which package it qualifies. gen-plugin-godocs: - The example-code loop now falls back to example.Code when example.Play is nil (go/doc leaves Play nil when it can't synthesize a whole runnable program), and propagates printer.Fprint errors instead of discarding them. No output change for the current server/public/plugin or server/public/model content — verified via a full regen. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: drop legacy-repo comment references, align jsdocs generator parser Remove "port of the old mattermost-developer-documentation Hugo shortcode" comments from the plugin doc generators/components now that they're fully native to this monorepo, and switch gen-plugin-jsdocs.mjs from the TypeScript compiler API to @typescript-eslint/typescript-estree to match the old script's parser/shape, while keeping the more robust reArg-declared-parameter-name and node-scoped comment-attachment logic. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: bump plugin doc generators' go.mod to go 1.26 go 1.23 was arbitrarily low; align with a current Go version. go run auto-downloads a matching toolchain on older local installs, so this doesn't reintroduce a dependency on server/public/go.mod's version. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: handle RestElement in gen-plugin-jsdocs parameter extraction paramNamesFromPattern silently dropped rest parameters/destructured rest members (e.g. (a, ...rest) or {a, ...rest}), since RestElement matched none of its type checks. No effect on today's registry.ts output (no rest patterns currently used there), but keeps the extraction correct if one is ever introduced. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: simplify plugin doc generators README note Co-authored-by: Cursor <cursoragent@cursor.com> * docs: check stdout write errors in plugin doc generators os.Stdout.Write's return errors were discarded, so a failed/partial write (e.g. broken pipe, disk full) would still exit 0. Combined with the npm scripts' > file.tmp && mv pattern, a truncated write could be treated as a successful generation. Fatal on either write failing. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: flatten Server/Webapp plugin SDK reference sidebar nesting server/server-reference.md and webapp/webapp-reference.md were the only file in their respective folders, so the sidebar generator (which only collapses a folder into a single entry when it has an index.md) rendered them as a "Server" > "Server plugin SDK reference" category with one child instead of one flat entry, unlike every sibling reference folder (rest-api/index.md, bot-accounts/index.md, etc.). Rename both to index.md to match that convention, and update the ~20 cross-referencing links (many with #anchor fragments) that pointed at the old /reference/server/server-reference and /reference/webapp/webapp- reference paths. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
bcc9ce5e4a |
docs(P14): reconcile developer docs drift through Mattermost Blocks (#38043)
* docs(P14): reconcile developer docs drift through Mattermost Blocks * docs: fix developer docs MDX conversion * docs: clarify developer redirect filtering * docs: remove partial developer redirects |
||
|
|
78d120399f |
MM-68396: Remove deprecated dialog date/datetime fields for v12.0 (#37759)
* Drop top-level min_date/max_date/time_interval and allow_manual_time_entry; require datetime_config (and manual_time_entry). Update docs, tests, and e2e fixtures accordingly. * update important-upgrade-notes.rst per Doc Impact Analysis |
||
|
|
6417c9342a |
docs: port P13/P14 content drift into monorepo (#37590)
* docs(P13c): add missing manage-plugins.mdx to Administration Guide Configure
source/administration-guide/configure/manage-plugins.rst existed in the
Sphinx repo pre-fork but was never carried over during the initial P2
move or the P13c Configure reconciliation pass. Port it verbatim
(RST -> MDX) with links/anchors verified against the current docs/main
tree (mmctl-command-line-tool, plugins, plugins-configuration-settings,
popular-integrations, environment-configuration-settings#maximum-file-size,
air-gapped-deployment).
#### Release Note
```release-note
NONE
```
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs(P13/P14): port remaining content drift into monorepo
Ports outstanding content-only drift identified in docs-experimental
phase-P13/P14: V11.9 docs major release content, Azure Blob Storage
guide, ID-attribute case-sensitivity notes, ranked attribute types and
attribute value masking for ABAC, plugin management guide linkage, and
the P14 markdown action buttons reference page with its
interactive-messages cross-reference. Excludes all automation/workflow
files, which are handled separately.
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs(sidebar): link top-level category headers to their landing page
buildCategory() only recognized a literal index.md(x) filename as a
category's landing page, but Overview, Deployment Guide, Administration
Guide, Security & Compliance, End User Guide, Integrations Guide, Get
Help, and Use Case Guide all use a *-index.md(x) filename instead (to
avoid collisions when flattening for URL stability). As a result,
clicking most top-level sidebar categories only expanded/collapsed the
list instead of navigating to their overview page. Recognize the
*-index.md(x) convention as a fallback so these categories link
correctly, matching the existing Deployment Guide/Overview behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs(P13/P14): fix blog link typo and restore dropped Open Source Components entry
Audit against Sphinx source (docs/source/product-overview/) found two
drops from the
|
||
|
|
70b62d9e3f |
docs: fix broken images, cross-links, and layout overflow after docs-experimental migration (#37418)
* docs: restore missing e2e/mobile push-notification images These developer-docs images existed in mattermost-developer-documentation's static assets but were never copied into the monorepo during the docs migration, leaving broken image links in e2e-cheatsheets.md and the mobile push-notification pages. Also fixes e2e-cheatsheets.md's image paths, which used Hugo-style relative paths that don't resolve under Docusaurus. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: fix broken outgoing webhooks screenshot path The image reference used an absolute path left over from the old Hugo site (/integrate/faq/images/...), which doesn't resolve under Docusaurus since no matching file exists under site/static. The image already lives co-located in docs/develop/integrate/faq/images/, so point to it with a relative path instead. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: delete Azure AKS deployment guide page The page's screenshots never made it into the monorepo during migration and don't exist under any known source (docs, docs-experimental, or mattermost-developer-documentation). Remove the page rather than ship broken images; drop it from the PDF book manifest and repoint its legacy redirect to the general Kubernetes deployment guide accordingly. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: fix heading levels on Kubernetes deploy guides deploy-k8s.mdx and deploy-k8s-oke.mdx used H1 (#) for their top-level in-page sections (Installation steps, Common Errors, etc.) instead of H2. Docusaurus' contentTitle extraction grabs the first H1 it finds anywhere in the doc, which stole the page title slot from the actual frontmatter title, so no title rendered at the top of the page. The flat H1/H2 mix also meant TOC entries for install steps rendered as a flat list at the page's TOC root instead of nested under their section, which made the TOC sidebar overflow/misrender on narrower/zoomed viewports. Bump every heading in both files one level (H1->H2->H3->H4) so the page title renders and the TOC nests correctly. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: fix TOC/layout horizontal overflow on wide code blocks The Kubernetes prerequisites page's TOC sidebar overflowed off-screen at higher browser zoom levels. Root cause: `.docMainContainer` has `max-width: none !important` (intentional, so OpenAPI's 2-column layout gets full width), but that removes the container's only width ceiling. Combined with the default flexbox `min-width: auto` on both the main container (in its outer flex row with the left sidebar) and the doc content column (in the inner content/TOC row), a sufficiently wide code block's intrinsic min-content size could drag the whole row wider than the viewport instead of scrolling within itself. Add `min-width: 0` at both flex levels so `overflow-x: auto` on code blocks and tables actually contains overflow locally, and make the responsive table-scroll CSS apply unconditionally instead of only under the 996px breakpoint (zoom shrinks effective layout width without re-triggering the media query). Also shorten the illustrative base64 example values in the AWS Aurora Postgres secret example, which were long enough on their own to be a secondary contributor to the same overflow. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: restore additional missing images found via full static-resolution scan Docusaurus's build-time image validator doesn't reliably warn on every broken absolute-path reference, so npm run build alone missed these. A direct scan of every image reference in docs/develop and docs/main against the filesystem turned up 38 more genuinely missing images (desktop architecture, VPN/Pritunl setup, docker dev environment, i18n-extract tooling, MVP program, onboarding, schema migration guide, plugin best-practices, and interactive-message screenshots) that were never copied over from mattermost-developer-documentation during migration. Two references (interactive-dialog-date.png and interactive-dialog-datetime.png) remain unresolved because no source image exists anywhere in the legacy repo. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: fix broken cross-links after .md to .mdx migration Several Calls admin guide pages and the air-gapped quick-start runbook were renamed from .md to .mdx during migration, but their internal cross-links still pointed at the old .md filenames (and, for setup-tls, the old flattened path), so Docusaurus couldn't resolve them. Found via a full scan of every relative markdown link under docs/main and docs/develop against the filesystem, since the build's own "couldn't be resolved" warnings don't reliably surface every broken link. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: remove broken date/datetime element screenshots These screenshots were never captured before migration (broken on the currently live docs.mattermost.com too), and no source image exists anywhere in the legacy repos to restore. Remove the broken references rather than leave a dead image link. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: move newly-restored desktop architecture images to static/ These 4 images were restored co-located next to their content files, matching an existing (if inconsistent) convention elsewhere in docs/develop. Since these are new additions rather than pre-existing working references, move them to docs/site/static/ instead of perpetuating the co-located pattern. Repo-wide normalization of the other ~70 existing co-located image references is left for a separate follow-up PR. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: remove deleted AKS page from sidebar generator's manual grouping master (#37402) fixed the sidebar generator's SRC path but this branch's deletion of deploy-k8s-aks.mdx still left a dangling reference in the Deployment Guide's manual Kubernetes grouping, which fails Docusaurus's sidebar-doc-id validation at build time. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
1d3bbc638b |
feat(docs): move docs-experimental content into monorepo docs/ (#37330)
* feat(docs): move docs-experimental content into monorepo docs/ Co-authored-by: Cursor <cursoragent@cursor.com> * Remove plan related files and comments * Cleanup comments, remove generated files --------- Co-authored-by: Cursor <cursoragent@cursor.com> |