SecurityContext.fromJson constructor
Creates a SecurityContext from JSON data.
Implementation
factory SecurityContext.fromJson(Map<String, dynamic> json) {
final tempAllowPrivilegeEscalationJson = json['allowPrivilegeEscalation'];
final tempCapabilitiesJson = json['capabilities'];
final tempPrivilegedJson = json['privileged'];
final tempProcMountJson = json['procMount'];
final tempReadOnlyRootFilesystemJson = json['readOnlyRootFilesystem'];
final tempRunAsGroupJson = json['runAsGroup'];
final tempRunAsNonRootJson = json['runAsNonRoot'];
final tempRunAsUserJson = json['runAsUser'];
final tempSeLinuxOptionsJson = json['seLinuxOptions'];
final tempSeccompProfileJson = json['seccompProfile'];
final tempWindowsOptionsJson = json['windowsOptions'];
final bool? tempAllowPrivilegeEscalation = tempAllowPrivilegeEscalationJson;
final Capabilities? tempCapabilities = tempCapabilitiesJson != null
? Capabilities.fromJson(tempCapabilitiesJson)
: null;
final bool? tempPrivileged = tempPrivilegedJson;
final String? tempProcMount = tempProcMountJson;
final bool? tempReadOnlyRootFilesystem = tempReadOnlyRootFilesystemJson;
final int? tempRunAsGroup = tempRunAsGroupJson;
final bool? tempRunAsNonRoot = tempRunAsNonRootJson;
final int? tempRunAsUser = tempRunAsUserJson;
final SELinuxOptions? tempSeLinuxOptions = tempSeLinuxOptionsJson != null
? SELinuxOptions.fromJson(tempSeLinuxOptionsJson)
: null;
final SeccompProfile? tempSeccompProfile = tempSeccompProfileJson != null
? SeccompProfile.fromJson(tempSeccompProfileJson)
: null;
final WindowsSecurityContextOptions? tempWindowsOptions =
tempWindowsOptionsJson != null
? WindowsSecurityContextOptions.fromJson(tempWindowsOptionsJson)
: null;
return SecurityContext(
allowPrivilegeEscalation: tempAllowPrivilegeEscalation,
capabilities: tempCapabilities,
privileged: tempPrivileged,
procMount: tempProcMount,
readOnlyRootFilesystem: tempReadOnlyRootFilesystem,
runAsGroup: tempRunAsGroup,
runAsNonRoot: tempRunAsNonRoot,
runAsUser: tempRunAsUser,
seLinuxOptions: tempSeLinuxOptions,
seccompProfile: tempSeccompProfile,
windowsOptions: tempWindowsOptions,
);
}