Dry run publish 1C access profiles
This commit is contained in:
@@ -3015,6 +3015,30 @@ async def get_project_access_profile_publish_plan(project_id: str, profile_name:
|
||||
return _build_access_profile_publish_plan(normalized, profile)
|
||||
|
||||
|
||||
@app.post("/projects/{project_id}/access/profiles/{profile_name}/publish-dry-run", response_model=SferaExtensionCallResponse)
|
||||
async def dry_run_project_access_profile_publish(project_id: str, profile_name: str) -> SferaExtensionCallResponse:
|
||||
settings = _project_settings_or_404(project_id)
|
||||
normalized = _load_normalized_project(project_id)
|
||||
if normalized is None:
|
||||
raise HTTPException(status_code=404, detail="NormalizedProject not found")
|
||||
profile = _access_profile_by_name(normalized, profile_name)
|
||||
if profile is None:
|
||||
raise HTTPException(status_code=404, detail="Access profile not found")
|
||||
plan = _build_access_profile_publish_plan(normalized, profile)
|
||||
if not plan.ready_for_extension:
|
||||
raise HTTPException(status_code=409, detail="Access profile publish plan is not ready for extension")
|
||||
return _call_sfera_extension(
|
||||
project_id,
|
||||
settings,
|
||||
SferaExtensionCallRequest(
|
||||
operation="access.profile.apply",
|
||||
payload=plan.extension_payload,
|
||||
dry_run=True,
|
||||
allow_mutation=False,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@app.get("/projects/{project_id}/imports/quality", response_model=ImportQualityResponse)
|
||||
async def get_import_quality(project_id: str) -> ImportQualityResponse:
|
||||
return _import_quality_response(project_id)
|
||||
@@ -6568,6 +6592,7 @@ _SFERA_EXTENSION_MUTATION_OPERATIONS = {
|
||||
"data.write",
|
||||
"data.delete",
|
||||
"metadata.apply",
|
||||
"access.profile.apply",
|
||||
"admin.command",
|
||||
}
|
||||
|
||||
@@ -6601,6 +6626,7 @@ def _sfera_extension_operation_path(operation: str) -> str:
|
||||
"data.write": "v1/data/write",
|
||||
"query.execute": "v1/query",
|
||||
"metadata.apply": "v1/metadata/apply",
|
||||
"access.profile.apply": "v1/metadata/apply",
|
||||
"admin.command": "v1/admin/command",
|
||||
}
|
||||
return mapping.get(operation, "v1/call")
|
||||
|
||||
Reference in New Issue
Block a user