# SecretReference Properties

- Package: [Aspire.Hosting.Docker](/reference/api/csharp/aspire.hosting.docker.md)
- Type: [SecretReference](/reference/api/csharp/aspire.hosting.docker/secretreference.md)
- Kind: `Properties`
- Members: `5`

Represents a reference to a secret within a Docker service configuration.

## Gid

- Name: `Gid`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/SecretReference.cs)

Represents the group ID (GID) associated with the secret reference in a Docker service node.

```csharp
public int? Gid { get; set; }
```

## Remarks

This property defines the group ID of the user for accessing the secret. It is optional and may be null if not specified.

## Mode

- Name: `Mode`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/SecretReference.cs)

Gets or sets the file mode for the secret reference. The mode defines the file permissions that will be applied to the secret when mounted. This is represented as an integer value.

```csharp
public int? Mode { get; set; }
```

## Source

- Name: `Source`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/SecretReference.cs)

Gets or sets the name of the source secret reference. This property is used to specify the source from which a secret or configuration is derived.

```csharp
public string? Source { get; set; }
```

## Target

- Name: `Target`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/SecretReference.cs)

Gets or sets the target path where the secret will be mounted within the container. This path is used to specify the destination location of the secret in the container's file system.

```csharp
public string? Target { get; set; }
```

## Uid

- Name: `Uid`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/SecretReference.cs)

Gets or sets the user ID (UID) associated with the secret reference. This property allows specifying the UID that will be assigned to the secret when it is mounted within a container.

```csharp
public int? Uid { get; set; }
```
