-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: Introduce database backend interface and update plugin system an…
…d boostrap accordingly (#949) Signed-off-by: Prateek Malhotra <someone1@gmail.com>
- Loading branch information
Showing
14 changed files
with
262 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package config | ||
|
||
import ( | ||
"sync" | ||
"time" | ||
|
||
"github.com/sirupsen/logrus" | ||
|
||
"github.com/ory/fosite" | ||
"github.com/ory/hydra/client" | ||
"github.com/ory/hydra/consent" | ||
"github.com/ory/hydra/jwk" | ||
"github.com/ory/hydra/pkg" | ||
) | ||
|
||
var ( | ||
backends = make(map[string]BackendManager) | ||
bmutex sync.Mutex | ||
) | ||
|
||
type BackendManager interface { | ||
Init(url string, l logrus.FieldLogger) error | ||
NewConsentManager(clientManager client.Manager, fs pkg.FositeStorer) consent.Manager | ||
NewOAuth2Manager(clientManager client.Manager, accessTokenLifespan time.Duration, tokenStrategy string) pkg.FositeStorer | ||
NewClientManager(hasher fosite.Hasher) client.Manager | ||
NewJWKManager(cipher *jwk.AEAD) jwk.Manager | ||
Ping() error | ||
Prefixes() []string | ||
} | ||
|
||
func RegisterBackend(b BackendManager) { | ||
bmutex.Lock() | ||
for _, prefix := range b.Prefixes() { | ||
backends[prefix] = b | ||
} | ||
bmutex.Unlock() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.