RamRoleArnCredential.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. class RamRoleArnCredential extends AbstractCredential
  21. {
  22. /**
  23. * @var string
  24. */
  25. private $accessKeyId;
  26. /**
  27. * @var string
  28. */
  29. private $accessSecret;
  30. /**
  31. * @var string
  32. */
  33. private $roleArn;
  34. /**
  35. * @var string
  36. */
  37. private $roleSessionName;
  38. /**
  39. * RamRoleArnCredential constructor.
  40. *
  41. * @param $accessKeyId
  42. * @param $accessSecret
  43. * @param $roleArn
  44. * @param $roleSessionName
  45. */
  46. public function __construct($accessKeyId, $accessSecret, $roleArn, $roleSessionName)
  47. {
  48. $this->accessKeyId = $accessKeyId;
  49. $this->accessSecret = $accessSecret;
  50. $this->roleArn = $roleArn;
  51. $this->roleSessionName = $roleSessionName;
  52. }
  53. /**
  54. * @return string
  55. */
  56. public function getAccessKeyId()
  57. {
  58. return $this->accessKeyId;
  59. }
  60. /**
  61. * @param $accessKeyId
  62. */
  63. public function setAccessKeyId($accessKeyId)
  64. {
  65. $this->accessKeyId = $accessKeyId;
  66. }
  67. /**
  68. * @return string
  69. */
  70. public function getAccessSecret()
  71. {
  72. return $this->accessSecret;
  73. }
  74. /**
  75. * @param $accessSecret
  76. */
  77. public function setAccessSecret($accessSecret)
  78. {
  79. $this->accessSecret = $accessSecret;
  80. }
  81. /**
  82. * @return string
  83. */
  84. public function getRoleArn()
  85. {
  86. return $this->roleArn;
  87. }
  88. /**
  89. * @param $roleArn
  90. */
  91. public function setRoleArn($roleArn)
  92. {
  93. $this->roleArn = $roleArn;
  94. }
  95. /**
  96. * @return string
  97. */
  98. public function getRoleSessionName()
  99. {
  100. return $this->roleSessionName;
  101. }
  102. /**
  103. * @param $roleSessionName
  104. */
  105. public function setRoleSessionName($roleSessionName)
  106. {
  107. $this->roleSessionName = $roleSessionName;
  108. }
  109. /**
  110. * @return null
  111. */
  112. public function getSecurityToken()
  113. {
  114. return null;
  115. }
  116. }