| 93 | } |
| 94 | |
| 95 | func PluginAuthConfigured(source Source, plugin Plugin, auth []AuthConfig) bool { |
| 96 | if AuthConfigured(auth, source.URL, RequestKindRegistry) { |
| 97 | return true |
| 98 | } |
| 99 | switch PluginInstallType(plugin) { |
| 100 | case InstallTypeDirect: |
| 101 | for _, artifact := range PluginArtifacts(plugin) { |
| 102 | if AuthConfigured(auth, artifact.URL, RequestKindArtifact) { |
| 103 | return true |
| 104 | } |
| 105 | } |
| 106 | case InstallTypeGitHubRelease: |
| 107 | return pluginGitHubReleaseAuthConfigured(plugin, auth) |
| 108 | } |
| 109 | return false |
| 110 | } |
| 111 | |
| 112 | func pluginGitHubReleaseAuthConfigured(plugin Plugin, auth []AuthConfig) bool { |
| 113 | owner, repo, errRepository := GitHubRepositoryParts(plugin.Repository) |