@@ -86,19 +86,25 @@ var (
86
86
return errors .New ("nil token entry" )
87
87
}
88
88
89
+ storage := ts .core .router .MatchingStorageByAPIPath (ctx , cubbyholeMountPath )
90
+ if storage == nil {
91
+ return fmt .Errorf ("no cubby mount entry" )
92
+ }
93
+ view := storage .(* BarrierView )
94
+
89
95
switch {
90
96
case te .NamespaceID == namespace .RootNamespaceID && ! strings .HasPrefix (te .ID , "s." ):
91
97
saltedID , err := ts .SaltID (ctx , te .ID )
92
98
if err != nil {
93
99
return err
94
100
}
95
- return ts .cubbyholeBackend .revoke (ctx , salt .SaltID (ts .cubbyholeBackend .saltUUID , saltedID , salt .SHA1Hash ))
101
+ return ts .cubbyholeBackend .revoke (ctx , view , salt .SaltID (ts .cubbyholeBackend .saltUUID , saltedID , salt .SHA1Hash ))
96
102
97
103
default :
98
104
if te .CubbyholeID == "" {
99
105
return fmt .Errorf ("missing cubbyhole ID while destroying" )
100
106
}
101
- return ts .cubbyholeBackend .revoke (ctx , te .CubbyholeID )
107
+ return ts .cubbyholeBackend .revoke (ctx , view , te .CubbyholeID )
102
108
}
103
109
}
104
110
)
@@ -1816,7 +1822,13 @@ func (ts *TokenStore) handleTidy(ctx context.Context, req *logical.Request, data
1816
1822
}
1817
1823
1818
1824
// List all the cubbyhole storage keys
1819
- cubbyholeKeys , err := ts .cubbyholeBackend .storageView .List (quitCtx , "" )
1825
+ view := ts .core .router .MatchingStorageByAPIPath (ctx , cubbyholeMountPath )
1826
+ if view == nil {
1827
+ return fmt .Errorf ("no cubby mount entry" )
1828
+ }
1829
+ bview := view .(* BarrierView )
1830
+
1831
+ cubbyholeKeys , err := bview .List (quitCtx , "" )
1820
1832
if err != nil {
1821
1833
return errwrap .Wrapf ("failed to fetch cubbyhole storage keys: {{err}}" , err )
1822
1834
}
@@ -2013,7 +2025,7 @@ func (ts *TokenStore) handleTidy(ctx context.Context, req *logical.Request, data
2013
2025
key := strings .TrimSuffix (key , "/" )
2014
2026
if ! validCubbyholeKeys [key ] {
2015
2027
ts .logger .Info ("deleting invalid cubbyhole" , "key" , key )
2016
- err = ts .cubbyholeBackend .revoke (quitCtx , key )
2028
+ err = ts .cubbyholeBackend .revoke (quitCtx , bview , key )
2017
2029
if err != nil {
2018
2030
tidyErrors = multierror .Append (tidyErrors , errwrap .Wrapf (fmt .Sprintf ("failed to revoke cubbyhole key %q: {{err}}" , key ), err ))
2019
2031
}
0 commit comments