Skip to content

Commit 16783dd

Browse files
committed
make fmt
1 parent 4332f0d commit 16783dd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/mongoproxy/plugins/authz/authzlib/resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type Resource struct {
1212
}
1313

1414
// getResource receives a map[string]string and returns the global, dbs, collections and fields
15+
//
1516
// it is attempting to access.
1617
func getResource(resource map[string]string) (r Resource, err error) {
1718
if resource["Global"] == "*" {

pkg/mongoproxy/plugins/authz/authzlib/utils.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ func appendArrayIfMissing(slice []string, other []string) []string {
2626
}
2727

2828
// splitURI receives a uri and returns the dbs, collections and fields
29+
//
2930
// it is attempting to access.
3031
//
3132
// uri examples:
33+
//
3234
// db/coll/fld -> [db] [coll] [fld]
3335
// db/coll/* -> [db] [coll] [*]
3436
// db/coll/fld1,fld2 -> [db] [coll] [fld1 fld2]
3537
// db/*/fld1,fld2 -> [db] [*] [fld1 fld2]
36-
//
3738
func splitURI(uri string) ([]string, []string, []string, error) {
3839
parts := strings.Split(uri, "/")
3940
if len(parts) > 3 {
@@ -65,9 +66,11 @@ func splitURI(uri string) ([]string, []string, []string, error) {
6566
// (e.g. some tree) which can evaluate the permissions without having to expand to
6667
// all possible options
6768
// expandResource returns a slice of potential resources that can appear
69+
//
6870
// in config given a single resource.
6971
//
7072
// Example:
73+
//
7174
// db/coll/fld -> [db/coll/fld db/coll/* db/*/fld db/*/*
7275
// */coll/fld */*/fld */coll/* */*/*]
7376
func expandResource(r Resource) []Resource {

0 commit comments

Comments
 (0)