private function serializeAuthBackend(\JsonSerializable $backend) { $data = $backend->jsonSerialize(); $result = ['name' => $data['name'], 'identifier' => $data['identifier'], 'configuration' => array_map(function (DefinitionParameter $parameter) { return $parameter->getTypeName(); }, $data['configuration'])]; if ($backend instanceof Backend) { $result['storage_class'] = $backend->getStorageClass(); $authBackends = $this->backendService->getAuthMechanismsByScheme(array_keys($backend->getAuthSchemes())); $result['supported_authentication_backends'] = array_keys($authBackends); } return $result; }
private function serializeAuthBackend(\JsonSerializable $backend) { $data = $backend->jsonSerialize(); $result = ['name' => $data['name'], 'identifier' => $data['identifier'], 'configuration' => $this->formatConfiguration($data['configuration'])]; if ($backend instanceof Backend) { $result['storage_class'] = $backend->getStorageClass(); $authBackends = $this->backendService->getAuthMechanismsByScheme(array_keys($backend->getAuthSchemes())); $result['supported_authentication_backends'] = array_keys($authBackends); $authConfig = array_map(function (AuthMechanism $auth) { return $this->serializeAuthBackend($auth)['configuration']; }, $authBackends); $result['authentication_configuration'] = array_combine(array_keys($authBackends), $authConfig); } return $result; }