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

Unified Diff: remoting/host/self_access_verifier.cc

Issue 8662001: Remove AccessVerifier interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/self_access_verifier.h ('k') | remoting/host/self_access_verifier_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/self_access_verifier.cc
diff --git a/remoting/host/self_access_verifier.cc b/remoting/host/self_access_verifier.cc
deleted file mode 100644
index 939ed4dd31bc41bbab3993f99daf0da76d7e5046..0000000000000000000000000000000000000000
--- a/remoting/host/self_access_verifier.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/host/self_access_verifier.h"
-
-#include "base/logging.h"
-#include "base/string_util.h"
-#include "remoting/host/host_config.h"
-
-namespace remoting {
-
-SelfAccessVerifier::SelfAccessVerifier()
- : initialized_(false) {
-}
-
-SelfAccessVerifier::~SelfAccessVerifier() { }
-
-bool SelfAccessVerifier::Init(HostConfig* config) {
- std::string host_jid;
-
- if (!config->GetString(kXmppLoginConfigPath, &host_jid) ||
- host_jid.empty()) {
- LOG(ERROR) << "XMPP credentials are not defined in the config.";
- return false;
- }
-
- host_jid_prefix_ = host_jid + '/';
- initialized_ = true;
-
- return true;
-}
-
-bool SelfAccessVerifier::VerifyPermissions(
- const std::string& client_jid,
- const std::string& encoded_access_token) {
- CHECK(initialized_);
-
- // Reject incoming connection if the client's jid is not an ASCII string.
- if (!IsStringASCII(client_jid)) {
- LOG(ERROR) << "Rejecting incoming connection from " << client_jid;
- return false;
- }
-
- // Check that the client has the same bare jid as the host, i.e.
- // client's full JID starts with host's bare jid. Comparison is case
- // insensitive.
- if (!StartsWithASCII(client_jid, host_jid_prefix_, false)) {
- LOG(ERROR) << "Rejecting incoming connection from " << client_jid;
- return false;
- }
-
- // Kick off directory access permissions.
- // TODO(ajwong): Actually implement this.
- return true;
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/host/self_access_verifier.h ('k') | remoting/host/self_access_verifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698