refact(session): Add context to session factory
This adds a context to the session.RepositoryFactory, allowing errors.NewDeprecated to be replaced with errors.New. It also removes the common.SessionRepoFactory, instead packages just directly import from the session package.
This commit is contained in:
25 files changed
+86
-70
No files matched your search
@@ -110,7 +110,7 @@ type Controller struct {
|
||||
OidcRepoFn common.OidcAuthRepoFactory
|
||||
PasswordAuthRepoFn common.PasswordAuthRepoFactory
|
||||
ServersRepoFn common.ServersRepoFactory
|
||||
SessionRepoFn common.SessionRepoFactory
|
||||
SessionRepoFn session.RepositoryFactory
|
||||
ConnectionRepoFn common.ConnectionRepoFactory
|
||||
StaticHostRepoFn common.StaticRepoFactory
|
||||
PluginHostRepoFn common.PluginHostRepoFactory
|
||||
@@ -337,7 +337,7 @@ func New(ctx context.Context, conf *Config) (*Controller, error) {
|
||||
return target.NewRepository(dbase, dbase, c.kms)
|
||||
}
|
||||
c.SessionRepoFn = func(opt ...session.Option) (*session.Repository, error) {
|
||||
return session.NewRepository(dbase, dbase, c.kms, opt...)
|
||||
return session.NewRepository(ctx, dbase, dbase, c.kms, opt...)
|
||||
}
|
||||
c.ConnectionRepoFn = func() (*session.ConnectionRepository, error) {
|
||||
return session.NewConnectionRepository(ctx, dbase, dbase, c.kms)
|
||||
|
||||
Reference in new issue
Block a user