Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
SeleniumHQ
GitHub Repository: SeleniumHQ/Selenium
Path: blob/trunk/rb/lib/selenium/webdriver/common/fedcm/account.rb
1990 views
1
# frozen_string_literal: true
2
3
# Licensed to the Software Freedom Conservancy (SFC) under one
4
# or more contributor license agreements. See the NOTICE file
5
# distributed with this work for additional information
6
# regarding copyright ownership. The SFC licenses this file
7
# to you under the Apache License, Version 2.0 (the
8
# "License"); you may not use this file except in compliance
9
# with the License. You may obtain a copy of the License at
10
#
11
# http://www.apache.org/licenses/LICENSE-2.0
12
#
13
# Unless required by applicable law or agreed to in writing,
14
# software distributed under the License is distributed on an
15
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
# KIND, either express or implied. See the License for the
17
# specific language governing permissions and limitations
18
# under the License.
19
20
module Selenium
21
module WebDriver
22
module FedCM
23
# Represents an account displayed in a FedCm account list.
24
# See: https://w3c-fedid.github.io/FedCM/#dictdef-identityprovideraccount
25
# https://w3c-fedid.github.io/FedCM/#webdriver-accountlist
26
class Account
27
LOGIN_STATE_SIGNIN = 'SignIn'
28
LOGIN_STATE_SIGNUP = 'SignUp'
29
30
attr_reader :account_id, :email, :name, :given_name, :picture_url,
31
:idp_config_url, :login_state, :terms_of_service_url, :privacy_policy_url
32
33
# steep:ignore:start
34
def initialize(**args)
35
@account_id = args['accountId']
36
@email = args['email']
37
@name = args['name']
38
@given_name = args['givenName']
39
@picture_url = args['pictureUrl']
40
@idp_config_url = args['idpConfigUrl']
41
@login_state = args['loginState']
42
@terms_of_service_url = args['termsOfServiceUrl']
43
@privacy_policy_url = args['privacyPolicyUrl']
44
end
45
# steep:ignore:end
46
end # Account
47
end # FedCM
48
end # WebDriver
49
end # Selenium
50
51