()
| 775 | } |
| 776 | |
| 777 | func (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 | |
| 799 | func (d *dependency) FileClient() inventory.FileClient { |
| 800 | if d.fileClient != nil { |
nothing calls this directly
no test coverage detected