-
Notifications
You must be signed in to change notification settings - Fork 8
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
better edge auth test #106
Conversation
pkg/sitewise/auth_test.go
Outdated
type AuthRequest struct { | ||
Username string `json:"username,omitempty"` | ||
Password string `json:"password,omitempty"` | ||
AuthMechanism string `json:"authMechanism,omitempty"` | ||
} |
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.
if this is useful in the test... maybe use it in the real function?
pkg/sitewise/auth_test.go
Outdated
resp["accessKeyId"] = "YEWZb5yVBl9llM9TQvn10hD4wmXKlUCNgXeCQY5YmssV55FzAFZgcta2FUw8lIcz" | ||
resp["secretAccessKey"] = "2wH5XvUVv2FKIxvvj3YNCblvMJkI67KbXZV6ZHiy2w16LPXZboZkYvCZymsyLFiW" | ||
resp["sessionToken"] = "glPPiSJwMx3iDuLm5BsVJVA0t5wXVhMNHFyaOkh68yz48V9rcRjRke6nJG4ErwFh" |
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.
just to avoid doubt -- can you make these invalid strings?
resp["accessKeyId"] = "dummyAccessKeyYEWZb5yVBl9llM9T..."
pkg/sitewise/auth_test.go
Outdated
} | ||
|
||
//helper function to create a certificate from a template and public key plus a parent certificate and private key | ||
func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) ( |
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.
func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) ( | |
func createCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) ( |
keep private unless required
pkg/sitewise/auth_test.go
Outdated
} | ||
|
||
// generate a certificate template for the test server TLS | ||
rootCertTmpl, err := CertTemplate() |
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.
to keep the test clear.... can you move in all the explicit (dummy/test) settings into the function?
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.
👍
see #101 (comment)