-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract session mode constants (#324)
- Loading branch information
Showing
9 changed files
with
40 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import ( | |
"github.com/golang-jwt/jwt/v5" | ||
"github.com/stretchr/testify/require" | ||
"github.com/ubuntu/authd-oidc-brokers/internal/broker" | ||
"github.com/ubuntu/authd-oidc-brokers/internal/broker/sessionmode" | ||
"github.com/ubuntu/authd-oidc-brokers/internal/providers" | ||
"github.com/ubuntu/authd-oidc-brokers/internal/providers/info" | ||
"github.com/ubuntu/authd-oidc-brokers/internal/testutils" | ||
|
@@ -118,7 +119,7 @@ func newSessionForTests(t *testing.T, b *broker.Broker, username, mode string) ( | |
username = "[email protected]" | ||
} | ||
if mode == "" { | ||
mode = "auth" | ||
mode = sessionmode.Login | ||
} | ||
|
||
id, key, err := b.NewSession(username, "some lang", mode) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Package sessionmode defines the session modes supported by the broker. | ||
package sessionmode | ||
|
||
const ( | ||
// Login is used when the session is for user login. | ||
Login = "login" | ||
// LoginOld is the old name for the login session, which is now deprecated but still used by authd until all broker | ||
// installations are updated. | ||
LoginOld = "auth" | ||
// ChangePassword is used when the session is for changing the user password. | ||
ChangePassword = "change-password" | ||
// ChangePasswordOld is the old name for the change-password session, which is now deprecated but still used by authd | ||
// until all broker installations are updated. | ||
ChangePasswordOld = "passwd" | ||
) |
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
...nticationModes/Get_only_password_if_token_exists_and_session_mode_is_the_old_passwd_value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- id: password | ||
label: Local Password Authentication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters