Skip to content

Commit

Permalink
HJ-7 - Add MicrosoftSQLServerMonitor support code (#5404)
Browse files Browse the repository at this point in the history
  • Loading branch information
andres-torres-marroquin authored Oct 24, 2024
1 parent f38f282 commit f4288b4
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import BIGQUERY_TYPE_INFO from "~/features/integrations/integration-type-info/bi
import DYNAMO_TYPE_INFO from "~/features/integrations/integration-type-info/dynamoInfo";
import GOOGLE_CLOUD_SQL_MYSQL_TYPE_INFO from "~/features/integrations/integration-type-info/googleCloudSQLMySQLInfo";
import GOOGLE_CLOUD_SQL_POSTGRES_TYPE_INFO from "~/features/integrations/integration-type-info/googleCloudSQLPostgresInfo";
import MICROSOFT_SQL_SERVER_TYPE_INFO from "~/features/integrations/integration-type-info/microsoftSQLServerInfo";
import RDS_MYSQL_TYPE_INFO from "~/features/integrations/integration-type-info/rdsMySQLInfo";
import RDS_POSTGRES_TYPE_INFO from "~/features/integrations/integration-type-info/rdsPostgresInfo";
import S3_TYPE_INFO from "~/features/integrations/integration-type-info/s3Info";
Expand All @@ -30,6 +31,7 @@ const INTEGRATION_TYPE_MAP: { [K in ConnectionType]?: IntegrationTypeInfo } = {
[ConnectionType.GOOGLE_CLOUD_SQL_MYSQL]: GOOGLE_CLOUD_SQL_MYSQL_TYPE_INFO,
[ConnectionType.GOOGLE_CLOUD_SQL_POSTGRES]:
GOOGLE_CLOUD_SQL_POSTGRES_TYPE_INFO,
[ConnectionType.MSSQL]: MICROSOFT_SQL_SERVER_TYPE_INFO,
[ConnectionType.RDS_MYSQL]: RDS_MYSQL_TYPE_INFO,
[ConnectionType.RDS_POSTGRES]: RDS_POSTGRES_TYPE_INFO,
[ConnectionType.S3]: S3_TYPE_INFO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const GOOGLE_CLOUD_SQL_MYSQL_TAGS = [
"Detection",
"Discovery",
"DSR automation",
"GCP",
"MySQL",
];

export const GoogleCloudSQLMySQLOverview = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const GOOGLE_CLOUD_SQL_POSTGRES_TAGS = [
"Detection",
"Discovery",
"DSR automation",
"GCP",
"Postgres",
];

export const GoogleCloudSQLPostgresOverview = () => (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { ListItem } from "fidesui";

import {
InfoHeading,
InfoText,
InfoUnorderedList,
} from "~/features/common/copy/components";
import ShowMoreContent from "~/features/common/copy/ShowMoreContent";
import { ConnectionCategory } from "~/features/integrations/ConnectionCategory";
import { AccessLevel, ConnectionType } from "~/types/api";

export const MICROSOFT_SQL_SERVER_PLACEHOLDER = {
name: "Microsoft SQL Server",
key: "microsoft_sql_server_placeholder",
connection_type: ConnectionType.MSSQL,
access: AccessLevel.READ,
created_at: "",
};

export const MICROSOFT_SQL_SERVER_TAGS = [
"Database",
"Detection",
"Discovery",
"Microsoft SQL Server",
];

export const MicrosoftSQLServerOverview = () => (
<>
<InfoHeading text="Overview" />
<InfoText>
Microsoft SQL Server, is a relational database management system (RDBMS)
developed by Microsoft. It is designed to store, manage, and retrieve data
as requested by other software applications, which may run either on the
same computer or across a network.
</InfoText>
<ShowMoreContent>
<InfoHeading text="Categories" />
<InfoUnorderedList>
<ListItem>Database</ListItem>
<ListItem>SQL database</ListItem>
<ListItem>Storage system</ListItem>
<ListItem>Data detection</ListItem>
<ListItem>Data discovery</ListItem>
</InfoUnorderedList>
<InfoHeading text="Permissions" />
<InfoText>
For detecting databases, Fides requires a user with the following
permissions/role:
</InfoText>
<InfoUnorderedList>
<ListItem>
CREATE LOGIN username WITH PASSWORD = &apos;password&apos;;
</ListItem>
<ListItem>GRANT SELECT, INSERT, UPDATE TO username;</ListItem>
</InfoUnorderedList>
</ShowMoreContent>
</>
);

const MICROSOFT_SQL_SERVER_TYPE_INFO = {
placeholder: MICROSOFT_SQL_SERVER_PLACEHOLDER,
category: ConnectionCategory.DATABASE,
overview: <MicrosoftSQLServerOverview />,
tags: MICROSOFT_SQL_SERVER_TAGS,
};

export default MICROSOFT_SQL_SERVER_TYPE_INFO;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const RDS_MYSQL_TAGS = [
"Database",
"Detection",
"Discovery",
"DSR automation",
"RDS",
"MySQL",
];

export const RDSMySQLOverview = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const RDS_POSTGRES_TAGS = [
"Database",
"Detection",
"Discovery",
"DSR automation",
"RDS",
"Postgres",
];

export const RDSPostgresOverview = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const SCYLLA_TAGS = [
"Detection",
"Discovery",
"DSR automation",
"ScyllaDB",
];

export const ScyllaOverview = () => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List
from typing import ClassVar, List, Optional

from pydantic import Field

Expand Down Expand Up @@ -34,16 +34,16 @@ class MicrosoftSQLServerSchema(ConnectionConfigSecretsSchema):
description="The password used to authenticate and access the database.",
json_schema_extra={"sensitive": True},
)
dbname: str = Field(
description="The name of the specific database within the database server that you want to connect to.",
dbname: Optional[str] = Field(
default=None,
title="Database",
description="The name of the specific database within the database server that you want to connect to.",
)

_required_components: ClassVar[List[str]] = [
"host",
"username",
"password",
"dbname",
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ def test_get_connection_secret_schema_mssql(
"type": "string",
},
},
"required": ["host", "username", "password", "dbname"],
"required": ["host", "username", "password"],
}

def test_get_connection_secret_schema_mysql(
Expand Down

0 comments on commit f4288b4

Please sign in to comment.