File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,11 @@ func (p *SAMLCacheProvider) IsValid() bool {
6161 return false
6262 }
6363 } else {
64- cache_path = p .Filename
64+ cache_path , err = homedir .Expand (p .Filename )
65+ if err != nil {
66+ logger .Debug ("Could not retrieve cache file location" , err )
67+ return false
68+ }
6569 }
6670 logger = logger .WithField ("Cache_file" , cache_path )
6771
@@ -126,7 +130,10 @@ func (p *SAMLCacheProvider) ReadRaw() (string, error) {
126130 return "" , errors .Wrap (err , "Could not retrieve cache file path" )
127131 }
128132 } else {
129- cache_path = p .Filename
133+ cache_path , err = homedir .Expand (p .Filename )
134+ if err != nil {
135+ return "" , errors .Wrap (err , "Could not retrieve cache file path" )
136+ }
130137 }
131138
132139 content , err := os .ReadFile (cache_path )
@@ -147,7 +154,10 @@ func (p *SAMLCacheProvider) WriteRaw(samlAssertion string) error {
147154 return errors .Wrap (err , "Could not retrieve cache file path" )
148155 }
149156 } else {
150- cache_path = p .Filename
157+ cache_path , err = homedir .Expand (p .Filename )
158+ if err != nil {
159+ return errors .Wrap (err , "Could not retrieve cache file path" )
160+ }
151161 }
152162
153163 // create the directory if it doesn't exist
You can’t perform that action at this time.
0 commit comments