Class: Clusters::Aws::AuthorizeRoleService
- Inherits:
-
Object
- Object
- Clusters::Aws::AuthorizeRoleService
- Defined in:
- app/services/clusters/aws/authorize_role_service.rb
Defined Under Namespace
Classes: Response
Constant Summary collapse
- ERRORS =
[ ActiveRecord::RecordInvalid, ActiveRecord::RecordNotFound, Clusters::Aws::FetchCredentialsService::MissingRoleError, ::Aws::Errors::MissingCredentialsError, ::Aws::STS::Errors::ServiceError ].freeze
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(user, params:) ⇒ AuthorizeRoleService
constructor
A new instance of AuthorizeRoleService.
Constructor Details
#initialize(user, params:) ⇒ AuthorizeRoleService
Returns a new instance of AuthorizeRoleService.
18 19 20 21 |
# File 'app/services/clusters/aws/authorize_role_service.rb', line 18 def initialize(user, params:) @user = user @params = params end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user
6 7 8 |
# File 'app/services/clusters/aws/authorize_role_service.rb', line 6 def user @user end |
Instance Method Details
#execute ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'app/services/clusters/aws/authorize_role_service.rb', line 23 def execute ensure_role_exists! update_role_arn! Response.new(:ok, credentials) rescue *ERRORS => e Gitlab::ErrorTracking.track_exception(e) Response.new(:unprocessable_entity, {}) end |