Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
35
backend/internal/watcher/synthesizer/context.go
Normal file
35
backend/internal/watcher/synthesizer/context.go
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package synthesizer
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
|
||||
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
|
||||
"github.com/router-for-me/CLIProxyAPI/v7/sdk/pluginapi"
|
||||
)
|
||||
|
||||
// PluginAuthParser parses auth JSON owned by plugin providers.
|
||||
type PluginAuthParser interface {
|
||||
ParseAuth(context.Context, pluginapi.AuthParseRequest) (*coreauth.Auth, bool, error)
|
||||
}
|
||||
|
||||
// PluginMultiAuthParser expands one auth JSON payload into multiple plugin auth records.
|
||||
// Returning handled=true with an empty slice means the plugin intentionally suppresses built-in parsing.
|
||||
type PluginMultiAuthParser interface {
|
||||
ParseAuths(context.Context, pluginapi.AuthParseRequest) ([]*coreauth.Auth, bool, error)
|
||||
}
|
||||
|
||||
// SynthesisContext provides the context needed for auth synthesis.
|
||||
type SynthesisContext struct {
|
||||
// Config is the current configuration
|
||||
Config *config.Config
|
||||
// AuthDir is the directory containing auth files
|
||||
AuthDir string
|
||||
// Now is the current time for timestamps
|
||||
Now time.Time
|
||||
// IDGenerator generates stable IDs for auth entries
|
||||
IDGenerator *StableIDGenerator
|
||||
// PluginAuthParser parses plugin-owned auth files
|
||||
PluginAuthParser PluginAuthParser
|
||||
}
|
||||
Loading…
Reference in a new issue