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

Side by Side Diff: net/http/url_security_manager.h

Issue 1414313002: Allow dynamic updating of authentication policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various build problems detected on bots. Created 5 years, 1 month 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 #ifndef NET_HTTP_URL_SECURITY_MANAGER_H_ 5 #ifndef NET_HTTP_URL_SECURITY_MANAGER_H_
6 #define NET_HTTP_URL_SECURITY_MANAGER_H_ 6 #define NET_HTTP_URL_SECURITY_MANAGER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "net/base/net_export.h" 10 #include "net/base/net_export.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 const HttpAuthFilter* whitelist_delegate); 45 const HttpAuthFilter* whitelist_delegate);
46 46
47 // Returns true if we can send the default credentials to the server at 47 // Returns true if we can send the default credentials to the server at
48 // |auth_origin| for HTTP NTLM or Negotiate authentication. 48 // |auth_origin| for HTTP NTLM or Negotiate authentication.
49 virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const = 0; 49 virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const = 0;
50 50
51 // Returns true if Kerberos delegation is allowed for the server at 51 // Returns true if Kerberos delegation is allowed for the server at
52 // |auth_origin| for HTTP Negotiate authentication. 52 // |auth_origin| for HTTP Negotiate authentication.
53 virtual bool CanDelegate(const GURL& auth_origin) const = 0; 53 virtual bool CanDelegate(const GURL& auth_origin) const = 0;
54 54
55 virtual void SetDefaultWhitelist(const HttpAuthFilter* whitelist_default) = 0;
56 virtual void SetDelegateWhitelist(
57 const HttpAuthFilter* whitelist_delegate) = 0;
58
55 private: 59 private:
56 DISALLOW_COPY_AND_ASSIGN(URLSecurityManager); 60 DISALLOW_COPY_AND_ASSIGN(URLSecurityManager);
57 }; 61 };
58 62
59 class URLSecurityManagerWhitelist : public URLSecurityManager { 63 class URLSecurityManagerWhitelist : public URLSecurityManager {
60 public: 64 public:
61 // The URLSecurityManagerWhitelist takes ownership of the whitelists. 65 // The URLSecurityManagerWhitelist takes ownership of the whitelists.
62 URLSecurityManagerWhitelist(const HttpAuthFilter* whitelist_default, 66 URLSecurityManagerWhitelist(const HttpAuthFilter* whitelist_default,
63 const HttpAuthFilter* whitelist_delegation); 67 const HttpAuthFilter* whitelist_delegation);
64 ~URLSecurityManagerWhitelist() override; 68 ~URLSecurityManagerWhitelist() override;
65 69
66 // URLSecurityManager methods. 70 // URLSecurityManager methods.
67 bool CanUseDefaultCredentials(const GURL& auth_origin) const override; 71 bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
68 bool CanDelegate(const GURL& auth_origin) const override; 72 bool CanDelegate(const GURL& auth_origin) const override;
73 void SetDefaultWhitelist(const HttpAuthFilter* whitelist_default) override;
74 void SetDelegateWhitelist(const HttpAuthFilter* whitelist_delegate) override;
75
76 protected:
77 bool HasDefaultWhitelist() const;
69 78
70 private: 79 private:
71 scoped_ptr<const HttpAuthFilter> whitelist_default_; 80 scoped_ptr<const HttpAuthFilter> whitelist_default_;
72 scoped_ptr<const HttpAuthFilter> whitelist_delegate_; 81 scoped_ptr<const HttpAuthFilter> whitelist_delegate_;
73 82
74 DISALLOW_COPY_AND_ASSIGN(URLSecurityManagerWhitelist); 83 DISALLOW_COPY_AND_ASSIGN(URLSecurityManagerWhitelist);
75 }; 84 };
76 85
77 } // namespace net 86 } // namespace net
78 87
79 #endif // NET_HTTP_URL_SECURITY_MANAGER_H_ 88 #endif // NET_HTTP_URL_SECURITY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698