Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auth/integrationtest/asproject/admin_links_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestAdminGenerateLinks(t *testing.T) {
email := testkit.UniqueEmail(t)

signup, err := admin.GenerateLink(ctx, auth.NewLinkRequest(email).
Signup("integration-password").
Signup(testkit.Password).
UserMetadata(map[string]any{"workspace": "integration"}))
if err != nil {
t.Fatalf("GenerateLink(Signup): %v", err)
Expand Down
8 changes: 4 additions & 4 deletions auth/integrationtest/asproject/admin_users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestAdminUserLifecycle(t *testing.T) {

createResult, err := admin.CreateUser(t.Context(), auth.UserAttributes{
Email: email,
Password: "integration-password",
Password: testkit.Password,
EmailConfirm: true,
UserMetadata: map[string]any{"display_name": "Lifecycle"},
AppMetadata: map[string]any{"team": "integration"},
Expand Down Expand Up @@ -97,7 +97,7 @@ func TestAdminSoftDeleteUser(t *testing.T) {

createResult, err := admin.CreateUser(t.Context(), auth.UserAttributes{
Email: email,
Password: "integration-password",
Password: testkit.Password,
EmailConfirm: true,
})
if err != nil {
Expand Down Expand Up @@ -162,7 +162,7 @@ func TestAdminUpdateUser(t *testing.T) {

createResult, err := admin.CreateUser(t.Context(), auth.UserAttributes{
Email: email,
Password: "integration-password",
Password: testkit.Password,
EmailConfirm: true,
UserMetadata: map[string]any{"display_name": "Before", "locale": "en"},
})
Expand Down Expand Up @@ -266,7 +266,7 @@ func TestAdminListUsersPagination(t *testing.T) {
email := fmt.Sprintf("%s-%d@example.com", prefix, i)
result, err := admin.CreateUser(t.Context(), auth.UserAttributes{
Email: email,
Password: "integration-password",
Password: testkit.Password,
EmailConfirm: true,
})
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion integration-testing/testkit/testkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ type User struct {
RefreshToken string
}

// Password is the password every user SignUpUser registers signs in with.
// Password is the password the integration tests create their users with.
// It is public, so it must never reach a project other than the local stack.
const Password = "integration-password"

// UniqueEmail returns an email address unique to this test run, in lower
Expand Down
3 changes: 3 additions & 0 deletions scripts/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ done
# Sign a new user up over the Auth REST API, as an application's own sign-up
# flow does, and print Auth's JSON answer. $1 is the email address and $2 the
# password.
#
# Every password this script signs a user up with is public, so sign_up must
# never reach a project other than the local stack.
sign_up() {
curl --fail-with-body --silent --show-error \
--header "apikey: ${PUBLISHABLE_KEY}" \
Expand Down