|
| 1 | +// Licensed to the Software Freedom Conservancy (SFC) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The SFC licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | + |
| 18 | +package org.openqa.selenium.federatedcredentialmanagement; |
| 19 | + |
| 20 | +import java.util.Map; |
| 21 | + |
| 22 | +/** |
| 23 | + * Represents an account displayed in a FedCM account list. |
| 24 | + * |
| 25 | + * @see <a href="https://fedidcg.github.io/FedCM/#dictdef-identityprovideraccount"> |
| 26 | + * https://fedidcg.github.io/FedCM/#dictdef-identityprovideraccount</a> |
| 27 | + * @see <a href="https://fedidcg.github.io/FedCM/#webdriver-accountlist"> |
| 28 | + * https://fedidcg.github.io/FedCM/#webdriver-accountlist</a> |
| 29 | + */ |
| 30 | +public class FederatedCredentialManagementAccount { |
| 31 | + private final String accountId; |
| 32 | + private final String email; |
| 33 | + private final String name; |
| 34 | + private final String givenName; |
| 35 | + private final String pictureUrl; |
| 36 | + /** |
| 37 | + * The config URL of the identity provider that provided this account. |
| 38 | + * |
| 39 | + * This allows identifying the IDP in multi-IDP cases. |
| 40 | + */ |
| 41 | + private final String idpConfigUrl; |
| 42 | + /** |
| 43 | + * The login state for this account. |
| 44 | + * |
| 45 | + * One of LOGIN_STATE_SIGNIN and LOGIN_STATE_SIGNUP. |
| 46 | + */ |
| 47 | + private final String loginState; |
| 48 | + private final String termsOfServiceUrl; |
| 49 | + private final String privacyPolicyUrl; |
| 50 | + |
| 51 | + public static final String LOGIN_STATE_SIGNIN = "SignIn"; |
| 52 | + public static final String LOGIN_STATE_SIGNUP = "SignUp"; |
| 53 | + |
| 54 | + public FederatedCredentialManagementAccount(Map<String, String> dict) { |
| 55 | + accountId = (String) dict.getOrDefault("accountId", null); |
| 56 | + email = (String) dict.getOrDefault("email", null); |
| 57 | + name = (String) dict.getOrDefault("name", null); |
| 58 | + givenName = (String) dict.getOrDefault("givenName", null); |
| 59 | + pictureUrl = (String) dict.getOrDefault("pictureUrl", null); |
| 60 | + idpConfigUrl = (String) dict.getOrDefault("idpConfigUrl", null); |
| 61 | + loginState = (String) dict.getOrDefault("loginState", null); |
| 62 | + termsOfServiceUrl = (String) dict.getOrDefault("termsOfServiceUrl", null); |
| 63 | + privacyPolicyUrl = (String) dict.getOrDefault("privacyPolicyUrl", null); |
| 64 | + } |
| 65 | + |
| 66 | + public String getAccountid() { |
| 67 | + return accountId; |
| 68 | + } |
| 69 | + |
| 70 | + public String getEmail() { |
| 71 | + return email; |
| 72 | + } |
| 73 | + |
| 74 | + public String getName() { |
| 75 | + return name; |
| 76 | + } |
| 77 | + |
| 78 | + public String getGivenName() { |
| 79 | + return givenName; |
| 80 | + } |
| 81 | + |
| 82 | + public String getPictureUrl() { |
| 83 | + return pictureUrl; |
| 84 | + } |
| 85 | + |
| 86 | + public String getIdpConfigUrl() { |
| 87 | + return idpConfigUrl; |
| 88 | + } |
| 89 | + |
| 90 | + public String getLoginState() { |
| 91 | + return loginState; |
| 92 | + } |
| 93 | + |
| 94 | + public String getTermsOfServiceUrl() { |
| 95 | + return termsOfServiceUrl; |
| 96 | + } |
| 97 | + |
| 98 | + public String getPrivacyPolicyUrl() { |
| 99 | + return privacyPolicyUrl; |
| 100 | + } |
| 101 | +} |
0 commit comments