UserSecurityContext Class

  • java.lang.Object
    • com.azure.ai.openai.models.UserSecurityContext

Implements

public final class UserSecurityContext
implements JsonSerializable<UserSecurityContext>

User security context contains several parameters that describe the AI application itself, and the end user that interacts with the AI application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. (Learn more at https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.

Constructor Summary

Constructor Description
UserSecurityContext()

Creates an instance of UserSecurityContext class.

Method Summary

Modifier and Type Method and Description
static UserSecurityContext fromJson(JsonReader jsonReader)

Reads an instance of UserSecurityContext from the JsonReader.

String getApplicationName()

Get the applicationName property: The name of the application.

String getEndUserId()

Get the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application.

String getEndUserTenantId()

Get the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to.

String getSourceIp()

Get the sourceIp property: Captures the original client's IP address, accepting both IPv4 and IPv6 formats.

UserSecurityContext setApplicationName(String applicationName)

Set the applicationName property: The name of the application.

UserSecurityContext setEndUserId(String endUserId)

Set the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application.

UserSecurityContext setEndUserTenantId(String endUserTenantId)

Set the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to.

UserSecurityContext setSourceIp(String sourceIp)

Set the sourceIp property: Captures the original client's IP address, accepting both IPv4 and IPv6 formats.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

UserSecurityContext

public UserSecurityContext()

Creates an instance of UserSecurityContext class.

Method Details

fromJson

public static UserSecurityContext fromJson(JsonReader jsonReader)

Reads an instance of UserSecurityContext from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of UserSecurityContext if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the UserSecurityContext.

getApplicationName

public String getApplicationName()

Get the applicationName property: The name of the application. Sensitive personal information should not be included in this field.

Returns:

the applicationName value.

getEndUserId

public String getEndUserId()

Get the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.

Returns:

the endUserId value.

getEndUserTenantId

public String getEndUserTenantId()

Get the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multi tenant.

Returns:

the endUserTenantId value.

getSourceIp

public String getSourceIp()

Get the sourceIp property: Captures the original client's IP address, accepting both IPv4 and IPv6 formats.

Returns:

the sourceIp value.

setApplicationName

public UserSecurityContext setApplicationName(String applicationName)

Set the applicationName property: The name of the application. Sensitive personal information should not be included in this field.

Parameters:

applicationName - the applicationName value to set.

Returns:

the UserSecurityContext object itself.

setEndUserId

public UserSecurityContext setEndUserId(String endUserId)

Set the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.

Parameters:

endUserId - the endUserId value to set.

Returns:

the UserSecurityContext object itself.

setEndUserTenantId

public UserSecurityContext setEndUserTenantId(String endUserTenantId)

Set the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multi tenant.

Parameters:

endUserTenantId - the endUserTenantId value to set.

Returns:

the UserSecurityContext object itself.

setSourceIp

public UserSecurityContext setSourceIp(String sourceIp)

Set the sourceIp property: Captures the original client's IP address, accepting both IPv4 and IPv6 formats.

Parameters:

sourceIp - the sourceIp value to set.

Returns:

the UserSecurityContext object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to