Hello,
currently i try to create a verify-jwt plugin, which first reads a config.ini file with the ini package:
import (
...
"gopkg.in/ini.v1"
)
...
// New created a new Plugin plugin.
func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {
if len(config.Config_File) > 0 {
cfg, err := ini.Load(config.Config_File)
...
}
...
When ini.Load is called, the following error is shown in the treafik log:+
time="2024-02-26T08:14:34Z" level=error msg="plugins-local/src/verify-jwt/vendor/gopkg.in/ini.v1/section.go:38:3: panic" plugin=plugin-verify-jwt module=verify-jwt
time="2024-02-26T08:14:34Z" level=error msg="plugins-local/src/verify-jwt/vendor/gopkg.in/ini.v1/file.go:84:5: panic" module=verify-jwt plugin=plugin-verify-jwt
time="2024-02-26T08:14:34Z" level=error msg="plugins-local/src/verify-jwt/vendor/gopkg.in/ini.v1/parser.go:344:32: panic" module=verify-jwt plugin=plugin-verify-jwt
time="2024-02-26T08:14:34Z" level=error msg="plugins-local/src/verify-jwt/vendor/gopkg.in/ini.v1/file.go:292:12: panic" module=verify-jwt plugin=plugin-verify-jwt
time="2024-02-26T08:14:34Z" level=error msg="plugins-local/src/verify-jwt/vendor/gopkg.in/ini.v1/file.go:303:20: panic" module=verify-jwt plugin=plugin-verify-jwt
time="2024-02-26T08:14:34Z" level=error msg="plugins-local/src/verify-jwt/vendor/gopkg.in/ini.v1/ini.go:135:32: panic" plugin=plugin-verify-jwt module=verify-jwt
time="2024-02-26T08:14:34Z" level=error msg="plugins-local/src/verify-jwt/vendor/gopkg.in/ini.v1/ini.go:157:21: panic" plugin=plugin-verify-jwt module=verify-jwt
time="2024-02-26T08:14:34Z" level=error msg="plugins-local/src/verify-jwt/plugin.go:42:2: panic" plugin=plugin-verify-jwt module=verify-jwt
time="2024-02-26T08:14:34Z" level=error msg="Error in Go routine: reflect.Set: value of type *struct { Xoptions struct { Loose bool; Insensitive bool; InsensitiveSections bool; InsensitiveKeys bool; IgnoreContinuation bool; IgnoreInlineComment bool; SkipUnrecognizableLines bool; ShortCircuit bool; AllowBooleanKeys bool; AllowShadows bool; AllowNestedValues bool; AllowPythonMultilineValues bool; SpaceBeforeInlineComment bool; UnescapeValueDoubleQuotes bool; UnescapeValueCommentSymbols bool; UnparseableSections []string; KeyValueDelimiters string; KeyValueDelimiterOnWrite string; ChildSectionDelimiter string; PreserveSurroundedQuote bool; DebugFunc func(string); ReaderBufferSize int; AllowNonUniqueSections bool; AllowDuplicateShadowValues bool }; XdataSources []interp.valueInterface; BlockMode bool; Xlock sync.RWMutex; XsectionList []string; XsectionIndexes []int; Xsections map[string][]*struct { Xf *unsafe2.dummy; Comment string; Xname string; Xkeys map[string]*struct { Xs *unsafe2.dummy; Comment string; Xname string; Xvalue string; XisAutoIncrement bool; XisBooleanType bool; XisShadow bool; Xshadows []*unsafe2.dummy; XnestedValues []string }; XkeyList []string; XkeysHash map[string]string; XisRawSection bool; XrawBody string }; NameMapper func(string) string; ValueMapper func(string) string } is not assignable to type *struct { Xs *unsafe2.dummy; Comment string; Xname string; Xvalue string; XisAutoIncrement bool; XisBooleanType bool; XisShadow bool; Xshadows []*unsafe2.dummy; XnestedValues []string }"
The ini file exists and i can read it with os.ReadFile in die plugin. Any idea from the error log, why i can't use the ini package?