-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static file and dependency improvements
* Use rice instead of pkger * Move enforcer instantiation to server.go
- Loading branch information
Showing
15 changed files
with
77 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package assethelper | ||
|
||
import ( | ||
rice "github.com/GeertJohan/go.rice" | ||
) | ||
|
||
func loadStaticFile(filename string) (string, error) { | ||
box, err := rice.FindBox("../../static") | ||
if err != nil { | ||
return "", err | ||
} | ||
filestr, err := box.String(filename) | ||
if err != nil { | ||
return "", err | ||
} | ||
return filestr, nil | ||
} | ||
|
||
// LoadRBACBuiltinPolicy loads the builtin rbac-policy.csv | ||
func LoadRBACBuiltinPolicy() (string, error) { | ||
return loadStaticFile("rbac-policy.csv") | ||
} | ||
|
||
// LoadRBACAPIMappings loads the rbac-api-mappings.yml | ||
func LoadRBACAPIMappings() (string, error) { | ||
return loadStaticFile("rbac-api-mappings.yml") | ||
} | ||
|
||
// LoadRBACModel loads the rbac-model.conf | ||
func LoadRBACModel() (string, error) { | ||
return loadStaticFile("rbac-model.conf") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.