feat(19-04): user authorizer, user.Deleting and handle backfill
Register lighthouse user:{id} if the namespace is free, fire user.Deleting before unscoped delete, and backfill missing handles.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -103,10 +103,13 @@ func (p *Plugin) Boot(app *backpack.App) error {
|
||||
return err
|
||||
}
|
||||
trusted := surf.TrustedProxies(app.Config)
|
||||
return reg.Register(p.ID(), "api_token", &usermiddleware.APITokenGuard{
|
||||
if err := reg.Register(p.ID(), "api_token", &usermiddleware.APITokenGuard{
|
||||
App: app, Prefix: prefix,
|
||||
ClientIP: func(r *http.Request) string { return surf.ClientIP(r, trusted) },
|
||||
})
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return classes.RegisterUserAuthorizer(app)
|
||||
}
|
||||
|
||||
func (p *Plugin) startBlacklistSweep(bl bouncer.BlacklistStore) {
|
||||
@@ -201,7 +204,7 @@ func (p *Plugin) MailLayouts() map[string]string {
|
||||
}
|
||||
|
||||
func (p *Plugin) Commands() []bonfire.Command {
|
||||
return append([]bonfire.Command{console.RequirePasswordChange(p.app)}, console.APITokenCommands(p.app)...)
|
||||
return append([]bonfire.Command{console.RequirePasswordChange(p.app), console.BackfillHandles(p.app)}, console.APITokenCommands(p.app)...)
|
||||
}
|
||||
|
||||
func (p *Plugin) Migrations() []*gormigrate.Migration { return updates.All() }
|
||||
|
||||
Reference in New Issue
Block a user