cbentzel@chromium.org | 79cb5c1 | 2011-09-12 13:12:04 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
erg@google.com | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "net/base/auth.h" |
| 6 | |
| 7 | namespace net { |
| 8 | |
| 9 | AuthChallengeInfo::AuthChallengeInfo() : is_proxy(false) { |
| 10 | } |
| 11 | |
Emily Stark | f2c9bbd | 2019-04-09 17:08:58 | [diff] [blame] | 12 | AuthChallengeInfo::AuthChallengeInfo(const AuthChallengeInfo& other) = default; |
| 13 | |
Emily Stark | 08f6c97 | 2019-05-28 17:24:27 | [diff] [blame] | 14 | bool AuthChallengeInfo::MatchesExceptPath( |
| 15 | const AuthChallengeInfo& other) const { |
| 16 | return (is_proxy == other.is_proxy && challenger == other.challenger && |
| 17 | scheme == other.scheme && realm == other.realm && |
| 18 | challenge == other.challenge); |
erg@google.com | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 19 | } |
| 20 | |
Chris Watkins | 68b1503 | 2017-12-01 03:07:13 | [diff] [blame] | 21 | AuthChallengeInfo::~AuthChallengeInfo() = default; |
erg@google.com | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 22 | |
Chris Watkins | 68b1503 | 2017-12-01 03:07:13 | [diff] [blame] | 23 | AuthCredentials::AuthCredentials() = default; |
cbentzel@chromium.org | c2911d7 | 2011-10-03 22:16:36 | [diff] [blame] | 24 | |
Jan Wilken Dörrie | 739ccc21 | 2021-03-11 18:13:05 | [diff] [blame] | 25 | AuthCredentials::AuthCredentials(const std::u16string& username, |
| 26 | const std::u16string& password) |
| 27 | : username_(username), password_(password) {} |
cbentzel@chromium.org | f3cf980 | 2011-10-28 18:44:58 | [diff] [blame] | 28 | |
Chris Watkins | 68b1503 | 2017-12-01 03:07:13 | [diff] [blame] | 29 | AuthCredentials::~AuthCredentials() = default; |
cbentzel@chromium.org | c2911d7 | 2011-10-03 22:16:36 | [diff] [blame] | 30 | |
Jan Wilken Dörrie | 739ccc21 | 2021-03-11 18:13:05 | [diff] [blame] | 31 | void AuthCredentials::Set(const std::u16string& username, |
| 32 | const std::u16string& password) { |
cbentzel@chromium.org | f3cf980 | 2011-10-28 18:44:58 | [diff] [blame] | 33 | username_ = username; |
| 34 | password_ = password; |
| 35 | } |
| 36 | |
| 37 | bool AuthCredentials::Equals(const AuthCredentials& other) const { |
| 38 | return username_ == other.username_ && password_ == other.password_; |
| 39 | } |
| 40 | |
| 41 | bool AuthCredentials::Empty() const { |
| 42 | return username_.empty() && password_.empty(); |
| 43 | } |
| 44 | |
erg@google.com | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 45 | } // namespace net |