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:
Timothy Messier committed 2022-09-07 17:53:40 +00:00
1 parent febf0b9984
commit eb61ac6304
25 files changed
+86 -70

No files matched your search

+2 -2
View File
@@ -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)