Skip to content

Commit

Permalink
test: add authToken with password testcase (#3176)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrinds authored Sep 26, 2024
1 parent 49a2078 commit e93adb9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,23 @@ Pollers:
addr: a.b.c
credentials_script:
path: testdata/get_credentials_authToken
`,
},

{
name: "credentials_script returns authToken and password",
pollerName: "test",
want: PollerAuth{
AuthToken: "abcd",
HasCredentialScript: true,
Password: "script-password",
},
yaml: `
Pollers:
test:
addr: a.b.c
credentials_script:
path: testdata/get_credentials_authToken_password
`,
},
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/auth/testdata/get_credentials_authToken_password
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# Used by pkg/auth/auth_test.go
cat << EOF
password: "script-password"
authToken: abcd
EOF

0 comments on commit e93adb9

Please sign in to comment.