MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / GeneralAuth

Method GeneralAuth

application/dependency/dependency.go:777–797  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

775}
776
777func (d *dependency) GeneralAuth() auth.Auth {
778 if d.generalAuth != nil {
779 return d.generalAuth
780 }
781
782 var secretKey string
783 if d.ConfigProvider().System().Mode == conf.MasterMode {
784 secretKey = d.SettingProvider().SecretKey(context.Background())
785 } else {
786 secretKey = d.ConfigProvider().Slave().Secret
787 if secretKey == "" {
788 d.panicError(errors.New("SlaveSecret is not set, please specify it in config file"))
789 }
790 }
791
792 d.generalAuth = auth.HMACAuth{
793 SecretKey: []byte(secretKey),
794 }
795
796 return d.generalAuth
797}
798
799func (d *dependency) FileClient() inventory.FileClient {
800 if d.fileClient != nil {

Callers

nothing calls this directly

Calls 7

ConfigProviderMethod · 0.95
SettingProviderMethod · 0.95
panicErrorMethod · 0.95
SystemMethod · 0.65
SecretKeyMethod · 0.65
SlaveMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected