@@ -111,7 +111,6 @@ func migrateSessionsToSQLAndValidate(ctx context.Context,
111
111
112
112
overrideSessionTimeZone (kvSession )
113
113
overrideSessionTimeZone (migratedSession )
114
- overrideMacaroonRecipe (kvSession , migratedSession )
115
114
116
115
if ! reflect .DeepEqual (kvSession , migratedSession ) {
117
116
diff := difflib.UnifiedDiff {
@@ -329,28 +328,3 @@ func overrideSessionTimeZone(session *Session) {
329
328
session .RevokedAt = fixTime (session .RevokedAt )
330
329
}
331
330
}
332
-
333
- // overrideMacaroonRecipe overrides the MacaroonRecipe for the SQL session in a
334
- // certain scenario:
335
- // In the bbolt store, a session can have a non-nil macaroon struct, despite
336
- // both the permissions and caveats being nil. There is no way to represent this
337
- // in the SQL store, as the macaroon permissions and caveats are separate
338
- // tables. Therefore, in the scenario where a MacaroonRecipe exists for the
339
- // bbolt version, but both the permissions and caveats are nil, we override the
340
- // MacaroonRecipe for the SQL version and set it to a MacaroonRecipe with
341
- // nil permissions and caveats. This is needed to ensure that the deep equals
342
- // check in the migration validation does not fail in this scenario.
343
- func overrideMacaroonRecipe (kvSession * Session , migratedSession * Session ) {
344
- if kvSession .MacaroonRecipe != nil {
345
- kvPerms := kvSession .MacaroonRecipe .Permissions
346
- kvCaveats := kvSession .MacaroonRecipe .Caveats
347
-
348
- if kvPerms == nil && kvCaveats == nil {
349
- migratedSession .MacaroonRecipe = & MacaroonRecipe {}
350
- } else if kvPerms == nil {
351
- migratedSession .MacaroonRecipe .Permissions = nil
352
- } else if kvCaveats == nil {
353
- migratedSession .MacaroonRecipe .Caveats = nil
354
- }
355
- }
356
- }
0 commit comments