GoogleCloudStorageTest.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. <?php
  2. use Google\Auth\HttpHandler\HttpHandlerFactory;
  3. use Google\Cloud\Core\Exception\BadRequestException;
  4. use Google\Cloud\Core\Exception\NotFoundException;
  5. use Google\Cloud\Storage\Bucket;
  6. use Google\Cloud\Storage\Connection\ConnectionInterface;
  7. use Google\Cloud\Storage\StorageClient;
  8. use Google\Cloud\Storage\StorageObject;
  9. use GuzzleHttp\Client;
  10. use PrivateBin\Data\GoogleCloudStorage;
  11. class GoogleCloudStorageTest extends PHPUnit_Framework_TestCase
  12. {
  13. private static $_client;
  14. private static $_bucket;
  15. public static function setUpBeforeClass()
  16. {
  17. $httpClient = new Client(array('debug'=>false));
  18. $handler = HttpHandlerFactory::build($httpClient);
  19. $name = 'pb-';
  20. $alphabet = 'abcdefghijklmnopqrstuvwxyz';
  21. for ($i = 0; $i < 29; ++$i) {
  22. $name .= $alphabet[rand(0, strlen($alphabet) - 1)];
  23. }
  24. self::$_client = new StorageClientStub(array());
  25. self::$_bucket = self::$_client->createBucket($name);
  26. }
  27. public function setUp()
  28. {
  29. ini_set('error_log', stream_get_meta_data(tmpfile())['uri']);
  30. $this->_model = GoogleCloudStorage::getInstance(array(
  31. 'bucket' => self::$_bucket->name(),
  32. 'prefix' => 'pastes',
  33. 'client' => self::$_client, ));
  34. }
  35. public function tearDown()
  36. {
  37. foreach (self::$_bucket->objects() as $object) {
  38. $object->delete();
  39. }
  40. }
  41. public static function tearDownAfterClass()
  42. {
  43. self::$_bucket->delete();
  44. }
  45. public function testFileBasedDataStoreWorks()
  46. {
  47. $this->_model->delete(Helper::getPasteId());
  48. // storing pastes
  49. $paste = Helper::getPaste(2, array('expire_date' => 1344803344));
  50. $this->assertFalse($this->_model->exists(Helper::getPasteId()), 'paste does not yet exist');
  51. $this->assertTrue($this->_model->create(Helper::getPasteId(), $paste), 'store new paste');
  52. $this->assertTrue($this->_model->exists(Helper::getPasteId()), 'paste exists after storing it');
  53. $this->assertFalse($this->_model->create(Helper::getPasteId(), $paste), 'unable to store the same paste twice');
  54. $this->assertEquals($paste, $this->_model->read(Helper::getPasteId()));
  55. // storing comments
  56. $this->assertFalse($this->_model->existsComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId()), 'comment does not yet exist');
  57. $this->assertTrue($this->_model->createComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId(), Helper::getComment()), 'store comment');
  58. $this->assertTrue($this->_model->existsComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId()), 'comment exists after storing it');
  59. $this->assertFalse($this->_model->createComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId(), Helper::getComment()), 'unable to store the same comment twice');
  60. $comment = Helper::getComment();
  61. $comment['id'] = Helper::getCommentId();
  62. $comment['parentid'] = Helper::getPasteId();
  63. $this->assertEquals(
  64. array($comment['meta']['created'] => $comment),
  65. $this->_model->readComments(Helper::getPasteId())
  66. );
  67. // deleting pastes
  68. $this->_model->delete(Helper::getPasteId());
  69. $this->assertFalse($this->_model->exists(Helper::getPasteId()), 'paste successfully deleted');
  70. $this->assertFalse($this->_model->existsComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId()), 'comment was deleted with paste');
  71. $this->assertFalse($this->_model->read(Helper::getPasteId()), 'paste can no longer be found');
  72. }
  73. /**
  74. * pastes a-g are expired and should get deleted, x never expires and y-z expire in an hour
  75. */
  76. public function testPurge()
  77. {
  78. $expired = Helper::getPaste(2, array('expire_date' => 1344803344));
  79. $paste = Helper::getPaste(2, array('expire_date' => time() + 3600));
  80. $keys = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'x', 'y', 'z');
  81. $ids = array();
  82. foreach ($keys as $key) {
  83. $ids[$key] = hash('fnv164', $key);
  84. $this->assertFalse($this->_model->exists($ids[$key]), "paste $key does not yet exist");
  85. if (in_array($key, array('x', 'y', 'z'))) {
  86. $this->assertTrue($this->_model->create($ids[$key], $paste), "store $key paste");
  87. } elseif ($key === 'x') {
  88. $this->assertTrue($this->_model->create($ids[$key], Helper::getPaste()), "store $key paste");
  89. } else {
  90. $this->assertTrue($this->_model->create($ids[$key], $expired), "store $key paste");
  91. }
  92. $this->assertTrue($this->_model->exists($ids[$key]), "paste $key exists after storing it");
  93. }
  94. $this->_model->purge(10);
  95. foreach ($ids as $key => $id) {
  96. if (in_array($key, array('x', 'y', 'z'))) {
  97. $this->assertTrue($this->_model->exists($id), "paste $key exists after purge");
  98. $this->_model->delete($id);
  99. } else {
  100. $this->assertFalse($this->_model->exists($id), "paste $key was purged");
  101. }
  102. }
  103. }
  104. public function testErrorDetection()
  105. {
  106. $this->_model->delete(Helper::getPasteId());
  107. $paste = Helper::getPaste(2, array('expire' => "Invalid UTF-8 sequence: \xB1\x31"));
  108. $this->assertFalse($this->_model->exists(Helper::getPasteId()), 'paste does not yet exist');
  109. $this->assertFalse($this->_model->create(Helper::getPasteId(), $paste), 'unable to store broken paste');
  110. $this->assertFalse($this->_model->exists(Helper::getPasteId()), 'paste does still not exist');
  111. }
  112. public function testCommentErrorDetection()
  113. {
  114. $this->_model->delete(Helper::getPasteId());
  115. $comment = Helper::getComment(1, array('nickname' => "Invalid UTF-8 sequence: \xB1\x31"));
  116. $this->assertFalse($this->_model->exists(Helper::getPasteId()), 'paste does not yet exist');
  117. $this->assertTrue($this->_model->create(Helper::getPasteId(), Helper::getPaste()), 'store new paste');
  118. $this->assertTrue($this->_model->exists(Helper::getPasteId()), 'paste exists after storing it');
  119. $this->assertFalse($this->_model->existsComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId()), 'comment does not yet exist');
  120. $this->assertFalse($this->_model->createComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId(), $comment), 'unable to store broken comment');
  121. $this->assertFalse($this->_model->existsComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId()), 'comment does still not exist');
  122. }
  123. /**
  124. * @throws Exception
  125. */
  126. public function testKeyValueStore()
  127. {
  128. $salt = bin2hex(random_bytes(256));
  129. $this->_model->setValue($salt, 'salt', 'master');
  130. $storedSalt = $this->_model->getValue('salt', 'master');
  131. $this->assertEquals($salt, $storedSalt);
  132. $this->_model->purgeValues('salt', time() + 60);
  133. $this->assertFalse($this->_model->getValue('salt', 'master'));
  134. $client = hash_hmac('sha512', '127.0.0.1', $salt);
  135. $expire = time();
  136. $this->_model->setValue($expire, 'traffic_limiter', $client);
  137. $storedExpired = $this->_model->getValue('traffic_limiter', $client);
  138. $this->assertEquals($expire, $storedExpired);
  139. $this->assertEquals($expire, $storedExpired);
  140. $this->_model->purgeValues('traffic_limiter', time() - 60);
  141. $this->assertEquals($storedExpired, $this->_model->getValue('traffic_limiter', $client));
  142. $this->_model->purgeValues('traffic_limiter', time() + 60);
  143. $this->assertFalse($this->_model->getValue('traffic_limiter', $client));
  144. $purgeAt = $expire + (15 * 60);
  145. $this->_model->setValue($purgeAt, 'purge_limiter', 'at');
  146. $storedPurgedAt = $this->_model->getValue('purge_limiter', 'at');
  147. $this->assertEquals($purgeAt, $storedPurgedAt);
  148. $this->_model->purgeValues('purge_limiter', time() + 60);
  149. $this->assertFalse($this->_model->getValue('purge_limiter', 'at'));
  150. }
  151. }
  152. /**
  153. * Class StorageClientStub provides a limited stub for performing the unit test
  154. */
  155. class StorageClientStub extends StorageClient
  156. {
  157. private $_config = null;
  158. private $_connection = null;
  159. private $_buckets = array();
  160. public function __construct(array $config = array())
  161. {
  162. $this->_config = $config;
  163. $this->_connection = new ConnectionInterfaceStub();
  164. }
  165. public function bucket($name, $userProject = false)
  166. {
  167. if (!key_exists($name, $this->_buckets)) {
  168. $b = new BucketStub($this->_connection, $name, array(), $this);
  169. $this->_buckets[$name] = $b;
  170. }
  171. return $this->_buckets[$name];
  172. }
  173. /**
  174. * @throws \Google\Cloud\Core\Exception\NotFoundException
  175. */
  176. public function deleteBucket($name)
  177. {
  178. if (key_exists($name, $this->_buckets)) {
  179. unset($this->_buckets[$name]);
  180. } else {
  181. throw new NotFoundException();
  182. }
  183. }
  184. public function buckets(array $options = array())
  185. {
  186. throw new BadMethodCallException('not supported by this stub');
  187. }
  188. public function registerStreamWrapper($protocol = null)
  189. {
  190. throw new BadMethodCallException('not supported by this stub');
  191. }
  192. public function unregisterStreamWrapper($protocol = null)
  193. {
  194. throw new BadMethodCallException('not supported by this stub');
  195. }
  196. public function signedUrlUploader($uri, $data, array $options = array())
  197. {
  198. throw new BadMethodCallException('not supported by this stub');
  199. }
  200. public function timestamp(\DateTimeInterface $timestamp, $nanoSeconds = null)
  201. {
  202. throw new BadMethodCallException('not supported by this stub');
  203. }
  204. public function getServiceAccount(array $options = array())
  205. {
  206. throw new BadMethodCallException('not supported by this stub');
  207. }
  208. public function hmacKeys(array $options = array())
  209. {
  210. throw new BadMethodCallException('not supported by this stub');
  211. }
  212. public function hmacKey($accessId, $projectId = null, array $metadata = array())
  213. {
  214. throw new BadMethodCallException('not supported by this stub');
  215. }
  216. public function createHmacKey($serviceAccountEmail, array $options = array())
  217. {
  218. throw new BadMethodCallException('not supported by this stub');
  219. }
  220. public function createBucket($name, array $options = array())
  221. {
  222. if (key_exists($name, $this->_buckets)) {
  223. throw new BadRequestException('already exists');
  224. }
  225. $b = new BucketStub($this->_connection, $name, array(), $this);
  226. $this->_buckets[$name] = $b;
  227. return $b;
  228. }
  229. }
  230. /**
  231. * Class BucketStub stubs a GCS bucket.
  232. */
  233. class BucketStub extends Bucket
  234. {
  235. public $_objects;
  236. private $_name;
  237. private $_info;
  238. private $_connection;
  239. private $_client;
  240. public function __construct(ConnectionInterface $connection, $name, array $info = array(), $client = null)
  241. {
  242. $this->_name = $name;
  243. $this->_info = $info;
  244. $this->_connection = $connection;
  245. $this->_objects = array();
  246. $this->_client = $client;
  247. }
  248. public function acl()
  249. {
  250. throw new BadMethodCallException('not supported by this stub');
  251. }
  252. public function defaultAcl()
  253. {
  254. throw new BadMethodCallException('not supported by this stub');
  255. }
  256. public function exists()
  257. {
  258. return true;
  259. }
  260. public function upload($data, array $options = array())
  261. {
  262. if (!is_string($data) || !key_exists('name', $options)) {
  263. throw new BadMethodCallException('not supported by this stub');
  264. }
  265. $name = $options['name'];
  266. $generation = '1';
  267. $o = new StorageObjectStub($this->_connection, $name, $this, $generation, $options);
  268. $this->_objects[$options['name']] = $o;
  269. $o->setData($data);
  270. }
  271. public function uploadAsync($data, array $options = array())
  272. {
  273. throw new BadMethodCallException('not supported by this stub');
  274. }
  275. public function getResumableUploader($data, array $options = array())
  276. {
  277. throw new BadMethodCallException('not supported by this stub');
  278. }
  279. public function getStreamableUploader($data, array $options = array())
  280. {
  281. throw new BadMethodCallException('not supported by this stub');
  282. }
  283. public function object($name, array $options = array())
  284. {
  285. if (key_exists($name, $this->_objects)) {
  286. return $this->_objects[$name];
  287. } else {
  288. return new StorageObjectStub($this->_connection, $name, $this, null, $options);
  289. }
  290. }
  291. public function objects(array $options = array())
  292. {
  293. $prefix = key_exists('prefix', $options) ? $options['prefix'] : '';
  294. return new CallbackFilterIterator(
  295. new ArrayIterator($this->_objects),
  296. function ($current, $key, $iterator) use ($prefix) {
  297. return substr($key, 0, strlen($prefix)) == $prefix;
  298. }
  299. );
  300. }
  301. public function createNotification($topic, array $options = array())
  302. {
  303. throw new BadMethodCallException('not supported by this stub');
  304. }
  305. public function notification($id)
  306. {
  307. throw new BadMethodCallException('not supported by this stub');
  308. }
  309. public function notifications(array $options = array())
  310. {
  311. throw new BadMethodCallException('not supported by this stub');
  312. }
  313. public function delete(array $options = array())
  314. {
  315. $this->_client->deleteBucket($this->_name);
  316. }
  317. public function update(array $options = array())
  318. {
  319. throw new BadMethodCallException('not supported by this stub');
  320. }
  321. public function compose(array $sourceObjects, $name, array $options = array())
  322. {
  323. throw new BadMethodCallException('not supported by this stub');
  324. }
  325. public function info(array $options = array())
  326. {
  327. throw new BadMethodCallException('not supported by this stub');
  328. }
  329. public function reload(array $options = array())
  330. {
  331. throw new BadMethodCallException('not supported by this stub');
  332. }
  333. public function name()
  334. {
  335. return $this->_name;
  336. }
  337. public static function lifecycle(array $lifecycle = array())
  338. {
  339. throw new BadMethodCallException('not supported by this stub');
  340. }
  341. public function currentLifecycle(array $options = array())
  342. {
  343. throw new BadMethodCallException('not supported by this stub');
  344. }
  345. public function isWritable($file = null)
  346. {
  347. throw new BadMethodCallException('not supported by this stub');
  348. }
  349. public function iam()
  350. {
  351. throw new BadMethodCallException('not supported by this stub');
  352. }
  353. public function lockRetentionPolicy(array $options = array())
  354. {
  355. throw new BadMethodCallException('not supported by this stub');
  356. }
  357. public function signedUrl($expires, array $options = array())
  358. {
  359. throw new BadMethodCallException('not supported by this stub');
  360. }
  361. public function generateSignedPostPolicyV4($objectName, $expires, array $options = array())
  362. {
  363. throw new BadMethodCallException('not supported by this stub');
  364. }
  365. }
  366. /**
  367. * Class StorageObjectStub stubs a GCS storage object.
  368. */
  369. class StorageObjectStub extends StorageObject
  370. {
  371. private $_name;
  372. private $_data;
  373. private $_info;
  374. private $_bucket;
  375. private $_generation;
  376. private $_exists = false;
  377. private $_connection;
  378. public function __construct(ConnectionInterface $connection, $name, $bucket, $generation = null, array $info = array(), $encryptionKey = null, $encryptionKeySHA256 = null)
  379. {
  380. $this->_name = $name;
  381. $this->_bucket = $bucket;
  382. $this->_generation = $generation;
  383. $this->_info = $info;
  384. $this->_connection = $connection;
  385. $timeCreated = new Datetime();
  386. $this->_info['metadata']['timeCreated'] = $timeCreated->format(GoogleCloudStorage::DATETIME_FORMAT);
  387. }
  388. public function acl()
  389. {
  390. throw new BadMethodCallException('not supported by this stub');
  391. }
  392. public function exists(array $options = array())
  393. {
  394. return key_exists($this->_name, $this->_bucket->_objects);
  395. }
  396. /**
  397. * @throws NotFoundException
  398. */
  399. public function delete(array $options = array())
  400. {
  401. if (key_exists($this->_name, $this->_bucket->_objects)) {
  402. unset($this->_bucket->_objects[$this->_name]);
  403. } else {
  404. throw new NotFoundException('key ' . $this->_name . ' not found.');
  405. }
  406. }
  407. /**
  408. * @throws NotFoundException
  409. */
  410. public function update(array $metadata, array $options = array())
  411. {
  412. if (!$this->_exists) {
  413. throw new NotFoundException('key ' . $this->_name . ' not found.');
  414. }
  415. $this->_info = $metadata;
  416. }
  417. public function copy($destination, array $options = array())
  418. {
  419. throw new BadMethodCallException('not supported by this stub');
  420. }
  421. public function rewrite($destination, array $options = array())
  422. {
  423. throw new BadMethodCallException('not supported by this stub');
  424. }
  425. public function rename($name, array $options = array())
  426. {
  427. throw new BadMethodCallException('not supported by this stub');
  428. }
  429. /**
  430. * @throws NotFoundException
  431. */
  432. public function downloadAsString(array $options = array())
  433. {
  434. if (!$this->_exists) {
  435. throw new NotFoundException('key ' . $this->_name . ' not found.');
  436. }
  437. return $this->_data;
  438. }
  439. public function downloadToFile($path, array $options = array())
  440. {
  441. throw new BadMethodCallException('not supported by this stub');
  442. }
  443. public function downloadAsStream(array $options = array())
  444. {
  445. throw new BadMethodCallException('not supported by this stub');
  446. }
  447. public function downloadAsStreamAsync(array $options = array())
  448. {
  449. throw new BadMethodCallException('not supported by this stub');
  450. }
  451. public function signedUrl($expires, array $options = array())
  452. {
  453. throw new BadMethodCallException('not supported by this stub');
  454. }
  455. public function signedUploadUrl($expires, array $options = array())
  456. {
  457. throw new BadMethodCallException('not supported by this stub');
  458. }
  459. public function beginSignedUploadSession(array $options = array())
  460. {
  461. throw new BadMethodCallException('not supported by this stub');
  462. }
  463. public function info(array $options = array())
  464. {
  465. return key_exists('metadata',$this->_info) ? $this->_info['metadata'] : array();
  466. }
  467. public function reload(array $options = array())
  468. {
  469. throw new BadMethodCallException('not supported by this stub');
  470. }
  471. public function name()
  472. {
  473. return $this->_name;
  474. }
  475. public function identity()
  476. {
  477. throw new BadMethodCallException('not supported by this stub');
  478. }
  479. public function gcsUri()
  480. {
  481. return sprintf(
  482. 'gs://%s/%s',
  483. $this->_bucket->name(),
  484. $this->_name
  485. );
  486. }
  487. public function setData($data)
  488. {
  489. $this->_data = $data;
  490. $this->_exists = true;
  491. }
  492. }
  493. /**
  494. * Class ConnectionInterfaceStub required for the stubs.
  495. */
  496. class ConnectionInterfaceStub implements ConnectionInterface
  497. {
  498. public function deleteAcl(array $args = array())
  499. {
  500. throw new BadMethodCallException('not supported by this stub');
  501. }
  502. public function getAcl(array $args = array())
  503. {
  504. throw new BadMethodCallException('not supported by this stub');
  505. }
  506. public function listAcl(array $args = array())
  507. {
  508. throw new BadMethodCallException('not supported by this stub');
  509. }
  510. public function insertAcl(array $args = array())
  511. {
  512. throw new BadMethodCallException('not supported by this stub');
  513. }
  514. public function patchAcl(array $args = array())
  515. {
  516. throw new BadMethodCallException('not supported by this stub');
  517. }
  518. public function deleteBucket(array $args = array())
  519. {
  520. throw new BadMethodCallException('not supported by this stub');
  521. }
  522. public function getBucket(array $args = array())
  523. {
  524. throw new BadMethodCallException('not supported by this stub');
  525. }
  526. public function listBuckets(array $args = array())
  527. {
  528. throw new BadMethodCallException('not supported by this stub');
  529. }
  530. public function insertBucket(array $args = array())
  531. {
  532. throw new BadMethodCallException('not supported by this stub');
  533. }
  534. public function getBucketIamPolicy(array $args)
  535. {
  536. throw new BadMethodCallException('not supported by this stub');
  537. }
  538. public function setBucketIamPolicy(array $args)
  539. {
  540. throw new BadMethodCallException('not supported by this stub');
  541. }
  542. public function testBucketIamPermissions(array $args)
  543. {
  544. throw new BadMethodCallException('not supported by this stub');
  545. }
  546. public function patchBucket(array $args = array())
  547. {
  548. throw new BadMethodCallException('not supported by this stub');
  549. }
  550. public function deleteObject(array $args = array())
  551. {
  552. throw new BadMethodCallException('not supported by this stub');
  553. }
  554. public function copyObject(array $args = array())
  555. {
  556. throw new BadMethodCallException('not supported by this stub');
  557. }
  558. public function rewriteObject(array $args = array())
  559. {
  560. throw new BadMethodCallException('not supported by this stub');
  561. }
  562. public function composeObject(array $args = array())
  563. {
  564. throw new BadMethodCallException('not supported by this stub');
  565. }
  566. public function getObject(array $args = array())
  567. {
  568. throw new BadMethodCallException('not supported by this stub');
  569. }
  570. public function listObjects(array $args = array())
  571. {
  572. throw new BadMethodCallException('not supported by this stub');
  573. }
  574. public function patchObject(array $args = array())
  575. {
  576. throw new BadMethodCallException('not supported by this stub');
  577. }
  578. public function downloadObject(array $args = array())
  579. {
  580. throw new BadMethodCallException('not supported by this stub');
  581. }
  582. public function insertObject(array $args = array())
  583. {
  584. throw new BadMethodCallException('not supported by this stub');
  585. }
  586. public function getNotification(array $args = array())
  587. {
  588. throw new BadMethodCallException('not supported by this stub');
  589. }
  590. public function deleteNotification(array $args = array())
  591. {
  592. throw new BadMethodCallException('not supported by this stub');
  593. }
  594. public function insertNotification(array $args = array())
  595. {
  596. throw new BadMethodCallException('not supported by this stub');
  597. }
  598. public function listNotifications(array $args = array())
  599. {
  600. throw new BadMethodCallException('not supported by this stub');
  601. }
  602. public function getServiceAccount(array $args = array())
  603. {
  604. throw new BadMethodCallException('not supported by this stub');
  605. }
  606. public function lockRetentionPolicy(array $args = array())
  607. {
  608. throw new BadMethodCallException('not supported by this stub');
  609. }
  610. public function createHmacKey(array $args = array())
  611. {
  612. throw new BadMethodCallException('not supported by this stub');
  613. }
  614. public function deleteHmacKey(array $args = array())
  615. {
  616. throw new BadMethodCallException('not supported by this stub');
  617. }
  618. public function getHmacKey(array $args = array())
  619. {
  620. throw new BadMethodCallException('not supported by this stub');
  621. }
  622. public function updateHmacKey(array $args = array())
  623. {
  624. throw new BadMethodCallException('not supported by this stub');
  625. }
  626. public function listHmacKeys(array $args = array())
  627. {
  628. throw new BadMethodCallException('not supported by this stub');
  629. }
  630. }