forked from forgejo/forgejo
Refactor web package and context package (#25298)
1. The "web" package shouldn't depends on "modules/context" package, instead, let each "web context" register themselves to the "web" package. 2. The old Init/Free doesn't make sense, so simplify it * The ctx in "Init(ctx)" is never used, and shouldn't be used that way * The "Free" is never called and shouldn't be called because the SSPI instance is shared --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
fc2115b494
commit
4e2f1ee58d
45 changed files with 218 additions and 292 deletions
|
@ -29,26 +29,11 @@ type Method interface {
|
|||
Verify(http *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) (*user_model.User, error)
|
||||
}
|
||||
|
||||
// Initializable represents a structure that requires initialization
|
||||
// It usually should only be called once before anything else is called
|
||||
type Initializable interface {
|
||||
// Init should be called exactly once before using any of the other methods,
|
||||
// in order to allow the plugin to allocate necessary resources
|
||||
Init(ctx context.Context) error
|
||||
}
|
||||
|
||||
// Named represents a named thing
|
||||
type Named interface {
|
||||
Name() string
|
||||
}
|
||||
|
||||
// Freeable represents a structure that is required to be freed
|
||||
type Freeable interface {
|
||||
// Free should be called exactly once before application closes, in order to
|
||||
// give chance to the plugin to free any allocated resources
|
||||
Free() error
|
||||
}
|
||||
|
||||
// PasswordAuthenticator represents a source of authentication
|
||||
type PasswordAuthenticator interface {
|
||||
Authenticate(user *user_model.User, login, password string) (*user_model.User, error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue