mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-08 22:08:03 -05:00
feat: make YouTube API key optional in setup
- Change API key setup question to optional - Add test for optional API key behavior - Ensure plugin configuration without API key - chore: incoming 1827 changelog entry
This commit is contained in:
6
cmd/generate_changelog/incoming/1827.txt
Normal file
6
cmd/generate_changelog/incoming/1827.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
### PR [#1827](https://github.com/danielmiessler/Fabric/pull/1827) by [ksylvan](https://github.com/ksylvan): Make YouTube API key optional in setup
|
||||
|
||||
- Make YouTube API key optional in setup process
|
||||
- Change API key setup question to optional configuration
|
||||
- Add test for optional API key behavior
|
||||
- Ensure plugin configuration works without API key
|
||||
@@ -69,7 +69,7 @@ func NewYouTube() (ret *YouTube) {
|
||||
EnvNamePrefix: plugins.BuildEnvVariablePrefix(label),
|
||||
}
|
||||
|
||||
ret.ApiKey = ret.AddSetupQuestion("API key", true)
|
||||
ret.ApiKey = ret.AddSetupQuestion("API key", false)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
19
internal/tools/youtube/youtube_optional_test.go
Normal file
19
internal/tools/youtube/youtube_optional_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package youtube
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNewYouTubeApiKeyOptional(t *testing.T) {
|
||||
yt := NewYouTube()
|
||||
|
||||
if yt.ApiKey == nil {
|
||||
t.Fatal("expected API key setup question to be initialized")
|
||||
}
|
||||
|
||||
if yt.ApiKey.Required {
|
||||
t.Fatalf("expected YouTube API key to be optional, but it is marked as required")
|
||||
}
|
||||
|
||||
if !yt.IsConfigured() {
|
||||
t.Fatalf("expected YouTube plugin to be considered configured without an API key")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user