wallet-sync-server/auth/auth_test.go
Daniel Krol 2fbcf6ee6d Get/Post WalletState, account recover, test client
A few things at once because it was faster to get a demo out the door. Skipping most test implementation though I made failing stubs so I know what to fill in later.

* Get/Post WalletState
* downloadKey/email so that a second client can log in, and/or recover from lost client
* Test client in Python to demonstrate the above
* Organize into packages
2022-01-04 16:07:23 -05:00

47 lines
1.3 KiB
Go

package auth
import (
"testing"
)
// Test stubs for now
func TestAuthValidateTokenRequest(t *testing.T) {
// also add a basic test case for this in TestServerAuthHandlerErrors to make sure it's called at all
t.Fatalf("Test me: Implement and test ValidateTokenRequest")
}
func TestAuthSignaturePass(t *testing.T) {
t.Fatalf("Test me: Valid siganture passes")
}
func TestAuthSignatureFail(t *testing.T) {
t.Fatalf("Test me: Valid siganture fails")
}
func TestAuthNewTokenSuccess(t *testing.T) {
t.Fatalf("Test me: New token passes. Different scopes etc.")
}
func TestAuthNewTokenFail(t *testing.T) {
t.Fatalf("Test me: New token fails (error generating random string? others?)")
}
func TestAuthScopeValid(t *testing.T) {
t.Fatalf("Test me: Scope Valid tests")
/*
authToken.Scope = "get-wallet-state"; authToken.ScopeValid("*")
authToken.Scope = "get-wallet-state"; authToken.ScopeValid("get-wallet-state")
// even things that haven't been defined yet, for simplicity
authToken.Scope = "bananas"; authToken.ScopeValid("*")
*/
}
func TestAuthScopeInvalid(t *testing.T) {
t.Fatalf("Test me: Scope Invalid tests")
/*
authToken.Scope = "get-wallet-state"; authToken.ScopeValid("bananas")
authToken.Scope = "bananas"; authToken.ScopeValid("get-wallet-state")
*/
}