Skip to content

Commit 12d7e0d

Browse files
authored
Merge pull request #23 from KelvinTegelaar/main
[pull] main from KelvinTegelaar:main
2 parents b8b7955 + 65176b0 commit 12d7e0d

File tree

7 files changed

+61
-94
lines changed

7 files changed

+61
-94
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24-
__*
24+
__*
25+
.next/*

deployment/AzureDeploymentTemplate.json

Lines changed: 18 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222
"metadata": {
2323
"description": "Your Github Repository token (see https://docs.microsoft.com/en-us/azure/static-web-apps/publish-azure-resource-manager?tabs=azure-cli#create-a-github-personal-access-token"
2424
}
25-
},
26-
"GithubAPIRepository": {
27-
"defaultValue": "https://github.com/KelvinTegelaar/CIPP-API",
28-
"type": "string",
29-
"metadata": {
30-
"description": "URL to your Github backend fork."
31-
}
3225
}
3326
},
3427
"variables": {
@@ -57,7 +50,7 @@
5750
"objectId": "[reference(resourceId('Microsoft.Web/sites', variables('funcAppName')),'2019-08-01', 'full').identity.principalId]",
5851
"permissions": {
5952
"keys": [],
60-
"secrets": ["all"],
53+
"secrets": [ "all" ],
6154
"certificates": []
6255
}
6356
}
@@ -116,7 +109,7 @@
116109
]
117110
}
118111
],
119-
"dependsOn": ["[resourceId('Microsoft.Web/sites', variables('funcAppName'))]"]
112+
"dependsOn": [ "[resourceId('Microsoft.Web/sites', variables('funcAppName'))]" ]
120113
},
121114
{
122115
"apiVersion": "2015-08-01",
@@ -135,7 +128,7 @@
135128
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('serverFarmName'))]",
136129
"siteConfig": {
137130
"Use32BitWorkerProcess": false,
138-
"powerShellVersion": "7.2",
131+
"powerShellVersion": "7.4",
139132
"appSettings": [
140133
{
141134
"name": "AzureWebJobsStorage",
@@ -154,45 +147,28 @@
154147
"value": "~4"
155148
},
156149
{
157-
"name": "ApplicationID",
158-
"value": "[concat('@Microsoft.KeyVault(SecretUri=https://',variables('uniqueResourceNameBase'), '.vault.azure.net/secrets/ApplicationId)')]"
159-
},
160-
{
161-
"name": "ApplicationSecret",
162-
"value": "[concat('@Microsoft.KeyVault(SecretUri=https://',variables('uniqueResourceNameBase'), '.vault.azure.net/secrets/ApplicationSecret)')]"
163-
},
164-
{
165-
"name": "RefreshToken",
166-
"value": "[concat('@Microsoft.KeyVault(SecretUri=https://',variables('uniqueResourceNameBase'), '.vault.azure.net/secrets/RefreshToken)')]"
167-
},
168-
{
169-
"name": "TenantID",
170-
"value": "[concat('@Microsoft.KeyVault(SecretUri=https://',variables('uniqueResourceNameBase'), '.vault.azure.net/secrets/tenantid)')]"
150+
"name": "WEBSITE_RUN_FROM_PACKAGE",
151+
"value": "1"
171152
},
172153
{
173154
"name": "FUNCTIONS_WORKER_RUNTIME",
174155
"value": "powershell"
175156
}
176157
]
177158
}
178-
},
179-
"resources": [
180-
{
181-
"apiVersion": "2015-08-01",
182-
"name": "web",
183-
"type": "sourcecontrols",
184-
"dependsOn": ["[resourceId('Microsoft.Web/sites/', variables('funcAppName'))]"],
185-
"properties": {
186-
"RepoUrl": "[parameters('GithubAPIRepository')]",
187-
"repositoryToken": "[parameters('GithubToken')]",
188-
"token": "[parameters('GithubToken')]",
189-
190-
"branch": "master",
191-
"publishRunbook": true,
192-
"IsManualIntegration": true
193-
}
194-
}
195-
]
159+
}
160+
},
161+
{
162+
"name": "[concat(variables('funcAppName'), '/ZipDeploy')]",
163+
"type": "Microsoft.Web/sites/extensions",
164+
"apiVersion": "2021-02-01",
165+
"location": "[resourceGroup().location]",
166+
"dependsOn": [
167+
"[resourceId('Microsoft.Web/sites', variables('funcAppName'))]"
168+
],
169+
"properties": {
170+
"packageUri": "https://cippreleases.blob.core.windows.net/cipp-api/latest.zip"
171+
}
196172
},
197173
{
198174
"type": "Microsoft.Storage/storageAccounts",

deployment/AzureDeploymentTemplate_regionoptions.json

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222
"metadata": {
2323
"description": "Your Github Repository token (see https://docs.microsoft.com/en-us/azure/static-web-apps/publish-azure-resource-manager?tabs=azure-cli#create-a-github-personal-access-token)"
2424
}
25-
},
26-
"GithubAPIRepository": {
27-
"defaultValue": "https://github.com/KelvinTegelaar/CIPP-API",
28-
"type": "string",
29-
"metadata": {
30-
"description": "URL to your Github backend fork."
31-
}
3225
}
3326
},
3427
"variables": {
@@ -57,7 +50,7 @@
5750
"objectId": "[reference(resourceId('Microsoft.Web/sites', variables('funcAppName')),'2019-08-01', 'full').identity.principalId]",
5851
"permissions": {
5952
"keys": [],
60-
"secrets": ["all"],
53+
"secrets": [ "all" ],
6154
"certificates": []
6255
}
6356
}
@@ -116,7 +109,7 @@
116109
]
117110
}
118111
],
119-
"dependsOn": ["[resourceId('Microsoft.Web/sites', variables('funcAppName'))]"]
112+
"dependsOn": [ "[resourceId('Microsoft.Web/sites', variables('funcAppName'))]" ]
120113
},
121114
{
122115
"apiVersion": "2015-08-01",
@@ -135,7 +128,7 @@
135128
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('serverFarmName'))]",
136129
"siteConfig": {
137130
"Use32BitWorkerProcess": false,
138-
"powerShellVersion": "7.2",
131+
"powerShellVersion": "7.4",
139132
"appSettings": [
140133
{
141134
"name": "AzureWebJobsStorage",
@@ -154,42 +147,28 @@
154147
"value": "~4"
155148
},
156149
{
157-
"name": "ApplicationID",
158-
"value": "[concat('@Microsoft.KeyVault(SecretUri=https://',variables('uniqueResourceNameBase'), '.vault.azure.net/secrets/ApplicationId)')]"
159-
},
160-
{
161-
"name": "ApplicationSecret",
162-
"value": "[concat('@Microsoft.KeyVault(SecretUri=https://',variables('uniqueResourceNameBase'), '.vault.azure.net/secrets/ApplicationSecret)')]"
163-
},
164-
{
165-
"name": "RefreshToken",
166-
"value": "[concat('@Microsoft.KeyVault(SecretUri=https://',variables('uniqueResourceNameBase'), '.vault.azure.net/secrets/RefreshToken)')]"
167-
},
168-
{
169-
"name": "TenantID",
170-
"value": "[concat('@Microsoft.KeyVault(SecretUri=https://',variables('uniqueResourceNameBase'), '.vault.azure.net/secrets/tenantid)')]"
150+
"name": "WEBSITE_RUN_FROM_PACKAGE",
151+
"value": "1"
171152
},
172153
{
173154
"name": "FUNCTIONS_WORKER_RUNTIME",
174155
"value": "powershell"
175156
}
176157
]
177158
}
178-
},
179-
"resources": [
180-
{
181-
"apiVersion": "2015-08-01",
182-
"name": "web",
183-
"type": "sourcecontrols",
184-
"dependsOn": ["[resourceId('Microsoft.Web/sites/', variables('funcAppName'))]"],
185-
"properties": {
186-
"RepoUrl": "[parameters('GithubAPIRepository')]",
187-
"branch": "master",
188-
"publishRunbook": true,
189-
"IsManualIntegration": true
190-
}
191-
}
192-
]
159+
}
160+
},
161+
{
162+
"name": "[concat(variables('funcAppName'), '/ZipDeploy')]",
163+
"type": "Microsoft.Web/sites/extensions",
164+
"apiVersion": "2021-02-01",
165+
"location": "[resourceGroup().location]",
166+
"dependsOn": [
167+
"[resourceId('Microsoft.Web/sites', variables('funcAppName'))]"
168+
],
169+
"properties": {
170+
"packageUri": "https://cippreleases.blob.core.windows.net/cipp-api/latest.zip"
171+
}
193172
},
194173
{
195174
"type": "Microsoft.Storage/storageAccounts",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cipp",
3-
"version": "6.4.0",
3+
"version": "6.4.1",
44
"description": "The CyberDrain Improved Partner Portal is a portal to help manage administration for Microsoft Partners.",
55
"homepage": "https://cipp.app/",
66
"bugs": {

public/version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.4.0
1+
6.4.1

src/components/utilities/CippAppPermissionBuilder.jsx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ const CippAppPermissionBuilder = ({
6060
} = useGenericGetRequestQuery({
6161
path: 'api/ExecServicePrincipals',
6262
})
63-
6463
const [createServicePrincipal, createResult] = useLazyGenericGetRequestQuery()
6564

6665
const removeServicePrincipal = (appId) => {
@@ -407,9 +406,17 @@ const CippAppPermissionBuilder = ({
407406
])
408407

409408
const ApiPermissionRow = ({ servicePrincipal = null }) => {
409+
const {
410+
data: servicePrincipalData = [],
411+
isFetching: spFetching,
412+
isSuccess: spIdSuccess,
413+
} = useGenericGetRequestQuery({
414+
path: 'api/ExecServicePrincipals?Id=' + servicePrincipal.id,
415+
})
416+
410417
return (
411418
<>
412-
{spSuccess && servicePrincipal !== null && (
419+
{spSuccess && servicePrincipal !== null && spIdSuccess && (
413420
<CRow>
414421
<CCol xl={12}>
415422
<CRow>
@@ -457,7 +464,7 @@ const CippAppPermissionBuilder = ({
457464
'.applicationPermissions'
458465
}
459466
label="Application Permissions"
460-
values={servicePrincipal?.appRoles
467+
values={servicePrincipalData?.Results?.appRoles
461468
?.filter((role) => {
462469
return newPermissions?.Permissions[
463470
servicePrincipal.appId
@@ -524,8 +531,9 @@ const CippAppPermissionBuilder = ({
524531
},
525532
{
526533
selector: (row) =>
527-
servicePrincipal.appRoles.find((role) => role.id === row.id)
528-
.description,
534+
servicePrincipalData?.Results?.appRoles.find(
535+
(role) => role.id === row.id,
536+
).description,
529537
name: 'Description',
530538
cell: cellGenericFormatter({ wrap: true }),
531539
maxWidth: '60%',
@@ -577,7 +585,7 @@ const CippAppPermissionBuilder = ({
577585
</CRow>
578586
<CRow>
579587
<CCol xl={12}>
580-
{servicePrincipal?.publishedPermissionScopes?.length == 0 && (
588+
{servicePrincipalData?.Results?.publishedPermissionScopes?.length == 0 && (
581589
<CCallout color="warning">
582590
<FontAwesomeIcon icon="exclamation-triangle" className="me-2" />
583591
No Published Delegated Permissions found.
@@ -594,8 +602,8 @@ const CippAppPermissionBuilder = ({
594602
}
595603
label="Delegated Permissions"
596604
values={
597-
servicePrincipal?.publishedPermissionScopes?.length > 0
598-
? servicePrincipal?.publishedPermissionScopes
605+
servicePrincipalData?.Results?.publishedPermissionScopes?.length > 0
606+
? servicePrincipalData?.Results?.publishedPermissionScopes
599607
.filter((scopes) => {
600608
return newPermissions?.Permissions[
601609
servicePrincipal.appId
@@ -664,7 +672,7 @@ const CippAppPermissionBuilder = ({
664672
},
665673
{
666674
selector: (row) =>
667-
servicePrincipal.publishedPermissionScopes.find(
675+
servicePrincipalData?.Results?.publishedPermissionScopes.find(
668676
(scope) => scope?.id === row?.id,
669677
)?.userConsentDescription ?? 'No Description',
670678
name: 'Description',
@@ -921,6 +929,9 @@ const CippAppPermissionBuilder = ({
921929
Object.keys(
922930
newPermissions?.MissingPermissions[perm],
923931
).map((type) => {
932+
if (!updatedPermissions.Permissions[perm][type]) {
933+
updatedPermissions.Permissions[perm][type] = []
934+
}
924935
newPermissions?.MissingPermissions[perm][type].map(
925936
(p) => {
926937
updatedPermissions.Permissions[perm][type].push(p)

version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.4.0
1+
6.4.1

0 commit comments

Comments
 (0)