Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTMDB-545: Update CloudProviderAccessService to support azure #508

Merged
merged 9 commits into from
Jul 28, 2023

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Jul 24, 2023

Description

Ticket: INTMDB-545

This PR updates CloudProviderAccessService to support Azure.

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Required Checklist:

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

@andreaangiolillo andreaangiolillo changed the title Intmdb 545 updates INTMDB-545: Updated Jul 26, 2023
@andreaangiolillo andreaangiolillo changed the title INTMDB-545: Updated INTMDB-545: Update CloudProviderAccessService to support azure Jul 26, 2023
@@ -29,7 +29,7 @@ type CloudProviderAccessService interface {
ListRoles(context.Context, string) (*CloudProviderAccessRoles, *Response, error)
GetRole(context.Context, string, string) (*CloudProviderAccessRole, *Response, error)
CreateRole(context.Context, string, *CloudProviderAccessRoleRequest) (*CloudProviderAccessRole, *Response, error)
AuthorizeRole(context.Context, string, string, *CloudProviderAuthorizationRequest) (*CloudProviderAccessRole, *Response, error)
AuthorizeRole(context.Context, string, string, *CloudProviderAccessRoleRequest) (*CloudProviderAccessRole, *Response, error)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breaking change

@@ -40,7 +40,8 @@ var _ CloudProviderAccessService = &CloudProviderAccessServiceOp{}

// CloudProviderAccessRoles an array of awsIamRoles objects.
type CloudProviderAccessRoles struct {
AWSIAMRoles []CloudProviderAccessRole `json:"awsIamRoles,omitempty"` // Unique identifier of AWS security group in this access list entry.
AWSIAMRoles []CloudProviderAccessRole `json:"awsIamRoles,omitempty"` // Unique identifier of AWS security group in this access list entry.
AzureServicePrincipals []CloudProviderAccessRole `json:"azureServicePrincipals,omitempty"` // Unique identifier of Azure security group in this access list entry.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example of a response from the get

{
    "awsIamRoles": [
        {
            "atlasAWSAccountArn": "arn:aws:iam::299602853325:root",
            "atlasAssumedRoleExternalId": "8924b876-7ed6-44bd-bb34-707263a27a6f",
            "authorizedDate": "2023-03-24T17:12:15Z",
            "createdDate": "2023-03-24T17:05:37Z",
            "featureUsages": [],
            "iamAssumedRoleArn": "arn:aws:iam::358363220050:role/mongodb-test-cloud-backup-export-bucket-role-EU_WEST_1_test",
            "providerName": "AWS",
            "roleId": "641dd86151ed5c67923984f1"
        }
    ],
    "azureServicePrincipals": [
        {
            "_id": "64bf8b5d199f4e4af9106580",
            "atlasAzureAppId": "6f2deb0d-be72-4524-a403-df531868bac0",
            "createdDate": "2023-07-25T08:44:13Z",
            "featureUsages": [],
            "lastUpdatedDate": "2023-07-25T08:44:13Z",
            "providerName": "AZURE",
            "servicePrincipalId": "48f1d2a6-d0e9-482a-83a4-b8dd7dddc5c1",
            "tenantId": "91405384-d71e-47f5-92dd-759e272cdc1c"
        }
    ]
}

@andreaangiolillo andreaangiolillo marked this pull request as ready for review July 26, 2023 10:45
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner July 26, 2023 10:45
@wtrocki
Copy link
Member

wtrocki commented Jul 26, 2023

Aligns with the sdkv2. LGTM

@andreaangiolillo andreaangiolillo merged commit 758bc52 into master Jul 28, 2023
@andreaangiolillo andreaangiolillo deleted the INTMDB-545_updates branch July 28, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants