-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: SSAPI Auth Token (BPS-281) #1990
Conversation
Test failures are because I copied over a test file from the other PR to add to it. The failure should be resolved once the unit test PR gets merged. |
@@ -51,12 +58,27 @@ func (cfg *Config) Validate() error { | |||
if cfg.Endpoint == "" { | |||
return errors.New("missing Splunk server endpoint") | |||
} | |||
if cfg.Username == "" { | |||
|
|||
if cfg.Username == "" && cfg.AuthToken == "" { | |||
return errors.New("missing Splunk username") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we update this error string?
return errors.New("missing Splunk username") | |
return errors.New("missing Splunk username or auth token") |
return errors.New("missing Splunk username") | ||
} | ||
if cfg.Password == "" { | ||
|
||
if cfg.Password == "" && cfg.AuthToken == "" { | ||
return errors.New("missing Splunk password") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return errors.New("missing Splunk password") | |
return errors.New("missing Splunk password or auth token") |
@@ -111,22 +111,32 @@ func (ssapir *splunksearchapireceiver) Shutdown(ctx context.Context) error { | |||
|
|||
func (ssapir *splunksearchapireceiver) runQueries(ctx context.Context) error { | |||
for _, search := range ssapir.config.Searches { | |||
// set default event batch size | |||
fmt.Println(search.EventBatchSize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Println(search.EventBatchSize) |
fmt.Println(search.EventBatchSize) | ||
if search.EventBatchSize == 0 { | ||
search.EventBatchSize = 100 | ||
fmt.Println(search.EventBatchSize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Println(search.EventBatchSize) |
Proposed Change
Adds auth tokens as an authentication option in addition to basic auth.
Checklist