true, supported authentication schemes */ private $authSchemes = []; /** @var AuthMechanism|callable authentication mechanism fallback */ private $legacyAuthMechanism; /** * @return class-string */ public function getStorageClass() { return $this->storageClass; } /** * @param string $class * @return $this */ public function setStorageClass($class) { $this->storageClass = $class; return $this; } /** * @return array */ public function getAuthSchemes() { if (empty($this->authSchemes)) { return [AuthMechanism::SCHEME_NULL => true]; } return $this->authSchemes; } /** * @param string $scheme * @return self */ public function addAuthScheme($scheme) { $this->authSchemes[$scheme] = true; return $this; } /** * @param array $parameters storage parameters, for dynamic mechanism selection * @return AuthMechanism */ public function getLegacyAuthMechanism(array $parameters = []) { if (is_callable($this->legacyAuthMechanism)) { return call_user_func($this->legacyAuthMechanism, $parameters); } return $this->legacyAuthMechanism; } public function setLegacyAuthMechanism(AuthMechanism $authMechanism): self { $this->legacyAuthMechanism = $authMechanism; return $this; } /** * @param callable $callback dynamic auth mechanism selection */ public function setLegacyAuthMechanismCallback(callable $callback): self { $this->legacyAuthMechanism = $callback; return $this; } /** * Serialize into JSON for client-side JS */ public function jsonSerialize(): array { $data = $this->jsonSerializeDefinition(); $data += $this->jsonSerializeIdentifier(); $data['backend'] = $data['name']; // legacy compat $data['priority'] = $this->getPriority(); $data['authSchemes'] = $this->getAuthSchemes(); return $data; } /** * Check if parameters are satisfied in a StorageConfig * * @param StorageConfig $storage * @return bool */ public function validateStorage(StorageConfig $storage) { return $this->validateStorageDefinition($storage); } } ref='#n10'>10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63