VirtualRamRoleArnCredential.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. namespace AlibabaCloud\Client\Tests\Unit\Credentials\Ini;
  3. /**
  4. * Class VirtualRamRoleArnCredential
  5. *
  6. * @codeCoverageIgnore
  7. *
  8. * @package AlibabaCloud\Client\Tests\Unit\Credentials\Ini
  9. */
  10. class VirtualRamRoleArnCredential extends VirtualAccessKeyCredential
  11. {
  12. /**
  13. * @return string
  14. */
  15. public static function noKey()
  16. {
  17. $content = <<<EOT
  18. [phpunit]
  19. enable = true
  20. type = ram_role_arn
  21. role_arn = role_arn
  22. role_session_name = role_session_name
  23. EOT;
  24. return (new static($content))->url();
  25. }
  26. /**
  27. * @return string
  28. */
  29. public static function noSecret()
  30. {
  31. $content = <<<EOT
  32. [phpunit]
  33. enable = true
  34. type = ram_role_arn
  35. access_key_id = access_key_id
  36. role_arn = role_arn
  37. role_session_name = role_session_name
  38. EOT;
  39. return (new static($content))->url();
  40. }
  41. /**
  42. * @return string
  43. */
  44. public static function noRoleArn()
  45. {
  46. $content = <<<EOT
  47. [phpunit]
  48. enable = true
  49. type = ram_role_arn
  50. access_key_id = access_key_id
  51. access_key_secret = access_key_secret
  52. role_session_name = role_session_name
  53. EOT;
  54. return (new static($content))->url();
  55. }
  56. /**
  57. * @return string
  58. */
  59. public static function noRoleSessionName()
  60. {
  61. $content = <<<EOT
  62. [phpunit]
  63. enable = true
  64. type = ram_role_arn
  65. access_key_id = access_key_id
  66. access_key_secret = access_key_secret
  67. role_arn = role_arn
  68. EOT;
  69. return (new static($content))->url();
  70. }
  71. /**
  72. * @return string
  73. */
  74. public static function client()
  75. {
  76. $content = <<<EOT
  77. [phpunit]
  78. enable = true
  79. type = ram_role_arn
  80. access_key_id = access_key_id
  81. access_key_secret = access_key_secret
  82. role_arn = role_arn
  83. role_session_name = role_session_name
  84. EOT;
  85. return (new static($content))->url();
  86. }
  87. }