Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15578440
D7380.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7380.diff
View Options
Index: src/applications/conduit/call/ConduitCall.php
===================================================================
--- src/applications/conduit/call/ConduitCall.php
+++ src/applications/conduit/call/ConduitCall.php
@@ -86,10 +86,17 @@
$this->request->setUser($user);
- if ($this->shouldRequireAuthentication()) {
- // TODO: As per below, this should get centralized and cleaned up.
- if (!$user->isLoggedIn() && !$user->isOmnipotent()) {
- throw new ConduitException("ERR-INVALID-AUTH");
+ if (!$this->shouldRequireAuthentication()) {
+ // No auth requirement here.
+ } else {
+
+ $allow_public = $this->handler->shouldAllowPublic() &&
+ PhabricatorEnv::getEnvConfig('policy.allow-public');
+ if (!$allow_public) {
+ if (!$user->isLoggedIn() && !$user->isOmnipotent()) {
+ // TODO: As per below, this should get centralized and cleaned up.
+ throw new ConduitException("ERR-INVALID-AUTH");
+ }
}
// TODO: This would be slightly cleaner by just using a Query, but the
Index: src/applications/conduit/method/ConduitAPIMethod.php
===================================================================
--- src/applications/conduit/method/ConduitAPIMethod.php
+++ src/applications/conduit/method/ConduitAPIMethod.php
@@ -104,6 +104,10 @@
return true;
}
+ public function shouldAllowPublic() {
+ return false;
+ }
+
public function shouldAllowUnguardedWrites() {
return false;
}
Index: src/applications/diffusion/conduit/ConduitAPI_diffusion_abstractquery_Method.php
===================================================================
--- src/applications/diffusion/conduit/ConduitAPI_diffusion_abstractquery_Method.php
+++ src/applications/diffusion/conduit/ConduitAPI_diffusion_abstractquery_Method.php
@@ -6,9 +6,14 @@
abstract class ConduitAPI_diffusion_abstractquery_Method
extends ConduitAPI_diffusion_Method {
+ public function shouldAllowPublic() {
+ return true;
+ }
+
public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE;
}
+
public function getMethodStatusDescription() {
return pht(
'See T2784 - migrating diffusion working copy calls to conduit methods. '.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 7, 7:05 PM (13 h, 59 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223126
Default Alt Text
D7380.diff (2 KB)
Attached To
Mode
D7380: Fix logged-out Diffusion calls to Conduit
Attached
Detach File
Event Timeline
Log In to Comment