SAML: Implement Name Templates for assertion_attribute_name option (#48022)

* provide public getter for config template variable regex

* add code comment

* Add documentation on assertion_name_mapping templates

* Add missing piece of SAML documentation while I'm in here.

* Update docs/sources/enterprise/saml/configure-saml.md

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Add a bit more documentation on error handling.

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
This commit is contained in:
Michael Mandrus
2022-04-27 16:29:15 -04:00
committed by GitHub
co-authored by Emil Tullstedt
parent 60ec10566f
commit 6945f1c483
3 changed files with 50 additions and 25 deletions
+5
View File
@@ -45,6 +45,11 @@ func AddExpander(name string, priority int64, e Expander) {
var regex = regexp.MustCompile(`\$(|__\w+){([^}]+)}`)
// Slightly hacky function to avoid code duplication. If this is eventually called in multiple places, consider refactoring or potentially adding more general helper functions to this package
func GetExpanderRegex() *regexp.Regexp {
return regex
}
func expandConfig(file *ini.File) error {
sort.Slice(expanders, func(i, j int) bool {
return expanders[i].priority < expanders[j].priority