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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package org.openqa.selenium.federatedcredentialmanagement;

import java.util.Map;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/**
* Represents an account displayed in a FedCM account list.
Expand All @@ -27,29 +29,30 @@
* @see <a href="https://w3c-fedid.github.io/FedCM/#webdriver-accountlist">
* https://w3c-fedid.github.io/FedCM/#webdriver-accountlist</a>
*/
@NullMarked
public class FederatedCredentialManagementAccount {
private final String accountId;
private final String email;
private final String name;
private final String givenName;
private final String pictureUrl;
private final @Nullable String accountId;
private final @Nullable String email;
private final @Nullable String name;
private final @Nullable String givenName;
private final @Nullable String pictureUrl;

/**
* The config URL of the identity provider that provided this account.
*
* <p>This allows identifying the IDP in multi-IDP cases.
*/
private final String idpConfigUrl;
private final @Nullable String idpConfigUrl;

/**
* The login state for this account.
*
* <p>One of LOGIN_STATE_SIGNIN and LOGIN_STATE_SIGNUP.
*/
private final String loginState;
private final @Nullable String loginState;

private final String termsOfServiceUrl;
private final String privacyPolicyUrl;
private final @Nullable String termsOfServiceUrl;
private final @Nullable String privacyPolicyUrl;

public static final String LOGIN_STATE_SIGNIN = "SignIn";
public static final String LOGIN_STATE_SIGNUP = "SignUp";
Expand All @@ -66,39 +69,39 @@ public FederatedCredentialManagementAccount(Map<String, String> dict) {
privacyPolicyUrl = (String) dict.getOrDefault("privacyPolicyUrl", null);
}

public String getAccountid() {
public @Nullable String getAccountid() {
return accountId;
}

public String getEmail() {
public @Nullable String getEmail() {
return email;
}

public String getName() {
public @Nullable String getName() {
return name;
}

public String getGivenName() {
public @Nullable String getGivenName() {
return givenName;
}

public String getPictureUrl() {
public @Nullable String getPictureUrl() {
return pictureUrl;
}

public String getIdpConfigUrl() {
public @Nullable String getIdpConfigUrl() {
return idpConfigUrl;
}

public String getLoginState() {
public @Nullable String getLoginState() {
return loginState;
}

public String getTermsOfServiceUrl() {
public @Nullable String getTermsOfServiceUrl() {
return termsOfServiceUrl;
}

public String getPrivacyPolicyUrl() {
public @Nullable String getPrivacyPolicyUrl() {
return privacyPolicyUrl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
package org.openqa.selenium.federatedcredentialmanagement;

import java.util.List;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/**
* Represents an open dialog of the Federated Credential Management API.
*
* @see <a href="https://w3c-fedid.github.io/FedCM/">https://w3c-fedid.github.io/FedCM/</a>
*/
@NullMarked
public interface FederatedCredentialManagementDialog {

String DIALOG_TYPE_ACCOUNT_LIST = "AccountChooser";
Expand All @@ -44,13 +47,13 @@ public interface FederatedCredentialManagementDialog {
*
* <p>One of DIALOG_TYPE_ACCOUNT_LIST and DIALOG_TYPE_AUTO_REAUTH.
*/
String getDialogType();
@Nullable String getDialogType();

/** Returns the title of the dialog. */
String getTitle();
@Nullable String getTitle();

/** Returns the subtitle of the dialog or null if none. */
String getSubtitle();
@Nullable String getSubtitle();

void clickDialog();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@

package org.openqa.selenium.federatedcredentialmanagement;

import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import org.openqa.selenium.Beta;

/** Used by classes to indicate that they can interact with FedCM dialogs. */
@Beta
@NullMarked
public interface HasFederatedCredentialManagement {
/**
* Disables the promise rejection delay.
Expand All @@ -45,5 +48,5 @@ public interface HasFederatedCredentialManagement {
* <p>Can be used with WebDriverWait like: wait.until(driver ->
* ((HasFederatedCredentialManagement) driver). getFederatedCredentialManagementDialog() != null);
*/
FederatedCredentialManagementDialog getFederatedCredentialManagementDialog();
@Nullable FederatedCredentialManagementDialog getFederatedCredentialManagementDialog();
}