Skip to content

Commit d2991f4

Browse files
committed
test: add all atlas tests
1 parent b0f44f1 commit d2991f4

File tree

5 files changed

+329
-25
lines changed

5 files changed

+329
-25
lines changed

.github/workflows/atlas_tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
name: Atlas Tests
33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request:
58
jobs:
69
run-tests-daily:

scripts/filter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ function filterOpenapi(openapi: OpenAPIV3_1.Document): OpenAPIV3_1.Document {
2727
"deleteCluster",
2828
"listClustersForAllProjects",
2929
"createDatabaseUser",
30+
"deleteDatabaseUser",
3031
"listDatabaseUsers",
3132
"listProjectIpAccessLists",
3233
"createProjectIpAccessList",
34+
"deleteProjectIpAccessList",
3335
];
3436

3537
const filteredPaths = {};

src/common/atlas/apiClient.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ export class ApiClient {
147147
return data;
148148
}
149149

150+
async deleteProjectIpAccessList(options: FetchOptions<operations["deleteProjectIpAccessList"]>) {
151+
await this.client.DELETE("/api/atlas/v2/groups/{groupId}/accessList/{entryValue}", options);
152+
}
153+
150154
async listClusters(options: FetchOptions<operations["listClusters"]>) {
151155
const { data } = await this.client.GET("/api/atlas/v2/groups/{groupId}/clusters", options);
152156
return data;
@@ -176,5 +180,9 @@ export class ApiClient {
176180
return data;
177181
}
178182

183+
async deleteDatabaseUser(options: FetchOptions<operations["deleteDatabaseUser"]>) {
184+
await this.client.DELETE("/api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username}", options);
185+
}
186+
179187
// DO NOT EDIT. This is auto-generated code.
180188
}

src/common/atlas/openapi.d.ts

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,26 @@ export interface paths {
9292
patch?: never;
9393
trace?: never;
9494
};
95+
"/api/atlas/v2/groups/{groupId}/accessList/{entryValue}": {
96+
parameters: {
97+
query?: never;
98+
header?: never;
99+
path?: never;
100+
cookie?: never;
101+
};
102+
get?: never;
103+
put?: never;
104+
post?: never;
105+
/**
106+
* Remove One Entry from One Project IP Access List
107+
* @description Removes one access list entry from the specified project's IP access list. Each entry in the project's IP access list contains one IP address, one CIDR-notated block of IP addresses, or one AWS Security Group ID. MongoDB Cloud only allows client connections to the cluster from entries in the project's IP access list. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This resource replaces the whitelist resource. MongoDB Cloud removed whitelists in July 2021. Update your applications to use this new resource. The `/groups/{GROUP-ID}/accessList` endpoint manages the database IP access list. This endpoint is distinct from the `orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist` endpoint, which manages the access list for MongoDB Cloud organizations.
108+
*/
109+
delete: operations["deleteProjectIpAccessList"];
110+
options?: never;
111+
head?: never;
112+
patch?: never;
113+
trace?: never;
114+
};
95115
"/api/atlas/v2/groups/{groupId}/clusters": {
96116
parameters: {
97117
query?: never;
@@ -172,6 +192,26 @@ export interface paths {
172192
patch?: never;
173193
trace?: never;
174194
};
195+
"/api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username}": {
196+
parameters: {
197+
query?: never;
198+
header?: never;
199+
path?: never;
200+
cookie?: never;
201+
};
202+
get?: never;
203+
put?: never;
204+
post?: never;
205+
/**
206+
* Remove One Database User from One Project
207+
* @description Removes one database user from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Stream Processing Owner role, or the Project Database Access Admin role.
208+
*/
209+
delete: operations["deleteDatabaseUser"];
210+
options?: never;
211+
head?: never;
212+
patch?: never;
213+
trace?: never;
214+
};
175215
}
176216
export type webhooks = Record<string, never>;
177217
export interface components {
@@ -5280,6 +5320,45 @@ export interface operations {
52805320
500: components["responses"]["internalServerError"];
52815321
};
52825322
};
5323+
deleteProjectIpAccessList: {
5324+
parameters: {
5325+
query?: {
5326+
/** @description Flag that indicates whether Application wraps the response in an `envelope` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. */
5327+
envelope?: components["parameters"]["envelope"];
5328+
/** @description Flag that indicates whether the response body should be in the prettyprint format. */
5329+
pretty?: components["parameters"]["pretty"];
5330+
};
5331+
header?: never;
5332+
path: {
5333+
/** @description Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.
5334+
*
5335+
* **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. */
5336+
groupId: components["parameters"]["groupId"];
5337+
/** @description Access list entry that you want to remove from the project's IP access list. This value can use one of the following: one AWS security group ID, one IP address, or one CIDR block of addresses. For CIDR blocks that use a subnet mask, replace the forward slash (`/`) with its URL-encoded value (`%2F`). When you remove an entry from the IP access list, existing connections from the removed address or addresses may remain open for a variable amount of time. The amount of time it takes MongoDB Cloud to close the connection depends upon several factors, including:
5338+
*
5339+
* - how your application established the connection,
5340+
* - how MongoDB Cloud or the driver using the address behaves, and
5341+
* - which protocol (like TCP or UDP) the connection uses. */
5342+
entryValue: string;
5343+
};
5344+
cookie?: never;
5345+
};
5346+
requestBody?: never;
5347+
responses: {
5348+
/** @description This endpoint does not return a response body. */
5349+
204: {
5350+
headers: {
5351+
[name: string]: unknown;
5352+
};
5353+
content: {
5354+
"application/vnd.atlas.2023-01-01+json": unknown;
5355+
};
5356+
};
5357+
403: components["responses"]["forbidden"];
5358+
404: components["responses"]["notFound"];
5359+
500: components["responses"]["internalServerError"];
5360+
};
5361+
};
52835362
listClusters: {
52845363
parameters: {
52855364
query?: {
@@ -5515,6 +5594,57 @@ export interface operations {
55155594
500: components["responses"]["internalServerError"];
55165595
};
55175596
};
5597+
deleteDatabaseUser: {
5598+
parameters: {
5599+
query?: {
5600+
/** @description Flag that indicates whether Application wraps the response in an `envelope` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. */
5601+
envelope?: components["parameters"]["envelope"];
5602+
/** @description Flag that indicates whether the response body should be in the prettyprint format. */
5603+
pretty?: components["parameters"]["pretty"];
5604+
};
5605+
header?: never;
5606+
path: {
5607+
/** @description Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.
5608+
*
5609+
* **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. */
5610+
groupId: components["parameters"]["groupId"];
5611+
/** @description The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. */
5612+
databaseName: string;
5613+
/** @description Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication:
5614+
*
5615+
* | Authentication Method | Parameter Needed | Parameter Value | username Format |
5616+
* |---|---|---|---|
5617+
* | AWS IAM | awsIAMType | ROLE | <abbr title="Amazon Resource Name">ARN</abbr> |
5618+
* | AWS IAM | awsIAMType | USER | <abbr title="Amazon Resource Name">ARN</abbr> |
5619+
* | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name |
5620+
* | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name |
5621+
* | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name |
5622+
* | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name |
5623+
* | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name |
5624+
* | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name |
5625+
* | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string |
5626+
* */
5627+
username: string;
5628+
};
5629+
cookie?: never;
5630+
};
5631+
requestBody?: never;
5632+
responses: {
5633+
/** @description This endpoint does not return a response body. */
5634+
204: {
5635+
headers: {
5636+
[name: string]: unknown;
5637+
};
5638+
content: {
5639+
"application/vnd.atlas.2023-01-01+json": unknown;
5640+
};
5641+
};
5642+
401: components["responses"]["unauthorized"];
5643+
403: components["responses"]["forbidden"];
5644+
404: components["responses"]["notFound"];
5645+
500: components["responses"]["internalServerError"];
5646+
};
5647+
};
55185648
}
55195649
type WithRequired<T, K extends keyof T> = T & {
55205650
[P in K]-?: T[P];

0 commit comments

Comments
 (0)