Revert "Implement project pulling from Azure DevOps using Service Pri… (#14977)

Revert "Implement project pulling from Azure DevOps using Service Principals (#14628)"

This reverts commit 2e2cd7f2de.
This commit is contained in:
Hao Liu
2024-03-11 10:05:24 -04:00
committed by GitHub
parent ee9eac15dc
commit b076cb00a9
7 changed files with 9 additions and 49 deletions

View File

@@ -32,7 +32,6 @@ const QS_CONFIG = getQSConfig('credentials', {
function CredentialLookup({
autoPopulate,
credentialTypeId,
credentialTypeIds,
credentialTypeKind,
credentialTypeNamespace,
fieldName,
@@ -62,9 +61,6 @@ function CredentialLookup({
const typeIdParams = credentialTypeId
? { credential_type: credentialTypeId }
: {};
const typeIdsParams = credentialTypeIds
? { credential_type__in: credentialTypeIds.join() }
: {};
const typeKindParams = credentialTypeKind
? { credential_type__kind: credentialTypeKind }
: {};
@@ -76,7 +72,6 @@ function CredentialLookup({
CredentialsAPI.read(
mergeParams(params, {
...typeIdParams,
...typeIdsParams,
...typeKindParams,
...typeNamespaceParams,
})
@@ -106,7 +101,6 @@ function CredentialLookup({
autoPopulate,
autoPopulateLookup,
credentialTypeId,
credentialTypeIds,
credentialTypeKind,
credentialTypeNamespace,
history.location.search,

View File

@@ -33,11 +33,6 @@ const fetchCredentials = async (credential) => {
results: [scmCredentialType],
},
},
{
data: {
results: [azurermCredentialType],
},
},
{
data: {
results: [insightsCredentialType],
@@ -50,14 +45,13 @@ const fetchCredentials = async (credential) => {
},
] = await Promise.all([
CredentialTypesAPI.read({ kind: 'scm' }),
CredentialTypesAPI.read({ namespace: 'azure_rm' }),
CredentialTypesAPI.read({ name: 'Insights' }),
CredentialTypesAPI.read({ kind: 'cryptography' }),
]);
if (!credential) {
return {
scm: { typeIds: [scmCredentialType.id, azurermCredentialType.id] },
scm: { typeId: scmCredentialType.id },
insights: { typeId: insightsCredentialType.id },
cryptography: { typeId: cryptographyCredentialType.id },
};
@@ -66,12 +60,8 @@ const fetchCredentials = async (credential) => {
const { credential_type_id } = credential;
return {
scm: {
typeIds: [scmCredentialType.id, azurermCredentialType.id],
value:
credential_type_id === scmCredentialType.id ||
credential_type_id === azurermCredentialType.id
? credential
: null,
typeId: scmCredentialType.id,
value: credential_type_id === scmCredentialType.id ? credential : null,
},
insights: {
typeId: insightsCredentialType.id,
@@ -377,13 +367,13 @@ function ProjectForm({ project, submitError, ...props }) {
});
const [scmTypeOptions, setScmTypeOptions] = useState(null);
const [credentials, setCredentials] = useState({
scm: { typeIds: null, value: null },
scm: { typeId: null, value: null },
insights: { typeId: null, value: null },
cryptography: { typeId: null, value: null },
});
const [signatureValidationCredentials, setSignatureValidationCredentials] =
useState({
scm: { typeIds: null, value: null },
scm: { typeId: null, value: null },
insights: { typeId: null, value: null },
cryptography: { typeId: null, value: null },
});

View File

@@ -52,7 +52,7 @@ export const ScmCredentialFormField = ({
return (
<CredentialLookup
credentialTypeIds={credential.typeIds}
credentialTypeId={credential.typeId}
label={t`Source Control Credential`}
value={credential.value}
onChange={onCredentialChange}