Documentation
¶
Overview ¶
Package optionmerge provides shared merge logic for the three protoc-gen-servora-* plugins (authn, authz, audit). All three follow identical semantics:
- method-level rule with mode != 0 (UNSPECIFIED) fully replaces the service default,
- method-level rule absent or mode == 0 inherits the service default,
- if neither contributes a non-zero mode, no rule applies.
"Mode" is conventionally the first field (field number 1) in each rule proto message.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Merge ¶
Merge returns the effective rule after applying service-level / method-level merge semantics. The result is always a deep clone so callers may mutate it.
hasMethod should be true if the method-level annotation was present in the proto descriptor (even if methodRule itself is non-nil, hasMethod == false means the annotation was absent and the caller pre-allocated a nil value).
Returns (result, true) when a usable rule exists; (zero, false) when neither side declares a non-UNSPECIFIED mode.
Types ¶
This section is empty.