Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: net/http/http_auth.cc

Issue 1414313002: Allow dynamic updating of authentication policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to cbentzel@'s comments. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_auth.h" 5 #include "net/http/http_auth.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/strings/string_tokenizer.h" 10 #include "base/strings/string_tokenizer.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "net/base/net_errors.h" 12 #include "net/base/net_errors.h"
13 #include "net/http/http_auth_challenge_tokenizer.h" 13 #include "net/http/http_auth_challenge_tokenizer.h"
14 #include "net/http/http_auth_handler.h" 14 #include "net/http/http_auth_handler.h"
15 #include "net/http/http_auth_handler_factory.h" 15 #include "net/http/http_auth_handler_factory.h"
16 #include "net/http/http_auth_scheme.h"
16 #include "net/http/http_request_headers.h" 17 #include "net/http/http_request_headers.h"
17 #include "net/http/http_response_headers.h" 18 #include "net/http/http_response_headers.h"
18 #include "net/http/http_util.h" 19 #include "net/http/http_util.h"
19 20
20 namespace net { 21 namespace net {
21 22
22 HttpAuth::Identity::Identity() : source(IDENT_SRC_NONE), invalid(true) {} 23 HttpAuth::Identity::Identity() : source(IDENT_SRC_NONE), invalid(true) {}
23 24
24 // static 25 // static
25 void HttpAuth::ChooseBestChallenge( 26 void HttpAuth::ChooseBestChallenge(
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return "server"; 125 return "server";
125 default: 126 default:
126 NOTREACHED(); 127 NOTREACHED();
127 return std::string(); 128 return std::string();
128 } 129 }
129 } 130 }
130 131
131 // static 132 // static
132 const char* HttpAuth::SchemeToString(Scheme scheme) { 133 const char* HttpAuth::SchemeToString(Scheme scheme) {
133 static const char* const kSchemeNames[] = { 134 static const char* const kSchemeNames[] = {
134 "basic", 135 kBasicAuthScheme, kDigestAuthScheme, kNtlmAuthScheme,
135 "digest", 136 kNegotiateAuthScheme, kSpdyProxyAuthScheme, kMockAuthScheme};
136 "ntlm",
137 "negotiate",
138 "spdyproxy",
139 "mock",
140 };
141 static_assert(arraysize(kSchemeNames) == AUTH_SCHEME_MAX, 137 static_assert(arraysize(kSchemeNames) == AUTH_SCHEME_MAX,
142 "http auth scheme names incorrect size"); 138 "http auth scheme names incorrect size");
143 if (scheme < AUTH_SCHEME_BASIC || scheme >= AUTH_SCHEME_MAX) { 139 if (scheme < AUTH_SCHEME_BASIC || scheme >= AUTH_SCHEME_MAX) {
144 NOTREACHED(); 140 NOTREACHED();
145 return "invalid_scheme"; 141 return "invalid_scheme";
146 } 142 }
147 return kSchemeNames[scheme]; 143 return kSchemeNames[scheme];
148 } 144 }
149 145
150 } // namespace net 146 } // namespace net
OLDNEW
« no previous file with comments | « net/android/http_auth_negotiate_android_unittest.cc ('k') | net/http/http_auth_handler_basic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698