diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-24 17:58:01 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-24 17:58:01 -0600 |
| commit | 72296119fc9755774719f8f625ad03e0e0ec457a (patch) | |
| tree | ed236ddee12a20fb55b7cfecf13f62d3a000dcb5 /vendor/github.com/authzed/spicedb/pkg/spiceerrors/util.go | |
| parent | a920a8cfe415858bb2777371a77018599ffed23f (diff) | |
| parent | eaa1bd3b8e12934aed06413d75e7482ac58d805a (diff) | |
Merge branch 'the-spice-must-flow' into 'main'
Add SpiceDB Authorization
See merge request gitlab-org/software-supply-chain-security/authorization/sparkled!19
Diffstat (limited to 'vendor/github.com/authzed/spicedb/pkg/spiceerrors/util.go')
| -rw-r--r-- | vendor/github.com/authzed/spicedb/pkg/spiceerrors/util.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/github.com/authzed/spicedb/pkg/spiceerrors/util.go b/vendor/github.com/authzed/spicedb/pkg/spiceerrors/util.go new file mode 100644 index 0000000..744e41b --- /dev/null +++ b/vendor/github.com/authzed/spicedb/pkg/spiceerrors/util.go @@ -0,0 +1,18 @@ +package spiceerrors + +import ( + "maps" +) + +type WithMetadata interface { + DetailsMetadata() map[string]string +} + +// CombineMetadata combines the metadata found on an existing error with that given. +func CombineMetadata(withMetadata WithMetadata, metadata map[string]string) map[string]string { + clone := maps.Clone(withMetadata.DetailsMetadata()) + for key, value := range metadata { + clone[key] = value + } + return clone +} |
