- Introduced a new system store management feature, allowing for the loading of predefined system stores such as cache and OAuth client stores. - Added a `loadSystemStores` function to handle the loading of system stores with variable replacement for configuration paths. - Enhanced the `Load` function to include the loading of system stores, improving the overall store management process. - Updated test utilities to support loading system stores for testing, ensuring comprehensive coverage and functionality. - Refactored the `replaceVars` function to facilitate variable replacement in JSON strings, enhancing flexibility in store configurations.
33 lines
1.3 KiB
Go
33 lines
1.3 KiB
Go
package openapi
|
|
|
|
import (
|
|
"github.com/yaoapp/yao/openapi/oauth"
|
|
"github.com/yaoapp/yao/openapi/oauth/types"
|
|
)
|
|
|
|
// Config is the configuration for the OpenAPI server
|
|
type Config struct {
|
|
BaseURL string `json:"baseurl" yaml:"baseurl"`
|
|
Providers *Providers `json:"providers,omitempty" yaml:"providers,omitempty"`
|
|
OAuth *OAuth `json:"oauth,omitempty" yaml:"oauth,omitempty"`
|
|
}
|
|
|
|
// Provider is the provider for the OpenAPI server, and in the future will be refactored into a struct
|
|
type Provider string
|
|
|
|
// Providers is the providers for the OpenAPI server
|
|
type Providers struct {
|
|
User Provider `json:"user,omitempty" yaml:"user,omitempty"`
|
|
Cache Provider `json:"cache,omitempty" yaml:"cache,omitempty"`
|
|
Client Provider `json:"client,omitempty" yaml:"client,omitempty"`
|
|
}
|
|
|
|
// OAuth is the OAuth configuration for the OpenAPI server
|
|
type OAuth struct {
|
|
IssuerURL string `json:"issuer_url,omitempty" yaml:"issuer_url,omitempty"`
|
|
Signing types.SigningConfig `json:"signing,omitempty" yaml:"signing,omitempty"`
|
|
Token types.TokenConfig `json:"token,omitempty" yaml:"token,omitempty"`
|
|
Security types.SecurityConfig `json:"security,omitempty" yaml:"security,omitempty"`
|
|
Client types.ClientConfig `json:"client,omitempty" yaml:"client,omitempty"`
|
|
Features oauth.FeatureFlags `json:"features,omitempty" yaml:"features,omitempty"`
|
|
}
|