Skip to content

docs(access-control): say an access rule pattern must match the whole value - #7019

Merged
otavio merged 3 commits into
masterfrom
docs/access-rule-pattern-semantics
Sep 2, 2026
Merged

docs(access-control): say an access rule pattern must match the whole value#7019
otavio merged 3 commits into
masterfrom
docs/access-rule-pattern-semantics

Conversation

@otavio

@otavio otavio commented Sep 2, 2026

Copy link
Copy Markdown
Member

Companion to #7018, which anchors the access rule matchers. That PR changes the behaviour; this one
changes everything that describes it.

The API specification and the console called these fields "regexps" and stopped there, which is
what leads an operator to write staging and expect the staging host. Anchoring is the part they
have to know, so it is now stated where the field is described rather than left to be discovered
from behaviour.

What changes

API specificationpublicKeyFilterRequest, publicKeyFilterResponse, publicKeyUsername,
accessPolicyFilterResponse, firewallRulesRequest, firewallRulesResponse.

Console — the public key, access policy and firewall rule drawers. The access policy drawer
also rendered the pattern between slashes, which reads as a regexp literal and so carries the
substring reading; and its placeholder taught ^prod-.*$, where the anchors are now redundant.

Manualaccess-policies, policy-reference, firewall-rules and public-keys under
/manage/access-control, each with the example that separates the two readings: staging covers
the device named staging and not staging-db; root authorizes the login root and not
notroot.

Also drops pkg/models/firewall.go. FirewallFilter, FirewallRuleFields, FirewallRule and
FirewallRuleUpdate had no caller in either repo — firewall rules are an enterprise feature and
the live types are cloud's own. Every module still builds without it, which is the evidence it was
dead.

Merge order

Merge after #7018. The wording here describes anchored matching, which that PR introduces.

The OpenAPI descriptions and the console's drawer copy called these fields
"regexps" and stopped there, which is what leads an operator to write
"staging" and expect the staging host. Anchoring is the part they have to
know, so state it where the field is described rather than leaving it to
the reader to discover from behaviour.

The examples name the failure the wording is there to prevent: "root"
authorizes the login root and not notroot; "staging" selects the device
named staging and not staging-db.
FirewallFilter, FirewallRuleFields, FirewallRule and FirewallRuleUpdate had
no caller in either repo. Firewall rules are an enterprise feature, so the
live types are cloud's own FirewallRule and FirewallRuleFilter in
cloud/pkg/models; from shellhub cloud takes only Taggable, Tag, Device and
FirewallConnection. The copy here was a second definition of the same
concept that no code could disagree with, because no code read it.

Every module still builds without it, which is the evidence it was dead.
The access policy device filter was the surface the earlier pass missed. Its
schema and the console drawer still described the field as "a regexp matched
against the device name", and the drawer rendered the value between slashes,
which reads as a regexp literal and so carries the substring reading the fix
removes. The placeholder taught the anchors as the way to get the obvious
meaning; under MatchPattern they are redundant, so it now shows the pattern a
reader would write.

The manual pages arrived after that pass and describe the same three selectors
from the operator's side, so they state it too, each with the example that
separates the two readings: "staging" covers the device named staging and not
staging-db, "root" authorizes the login root and not notroot.
@otavio
otavio requested review from a team as code owners September 2, 2026 18:01
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Claude finished @otavio's task in 2m 36s —— View job


Code Review Complete

Reviewed 14 files across code quality, security, testing, language patterns, and architecture — no new issues found. The code looks good as-is.

The one substantive change — deleting pkg/models/firewall.go (FirewallFilter, FirewallRuleFields, FirewallRule, FirewallRuleUpdate) — was verified dead: no Go reference to these types exists anywhere in the community repo (the only remaining FirewallRule mention is a prose example in server/api/services/tags.go:38), and cloud defines its own independent types in cloud/pkg/models/firewall-rule.go, importing only shmodels.Taggable from shellhub's pkg/models. Removing the file breaks no build or API contract. Everything else is description/prose and console string-literal edits with no behavioral change.


To request another review round, comment /review.
· docs/access-rule-pattern-semantics

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Documentation preview: https://31d11f38.shellhub-docs.pages.dev

@otavio
otavio merged commit a5c9607 into master Sep 2, 2026
43 checks passed
@otavio
otavio deleted the docs/access-rule-pattern-semantics branch September 2, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant