Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4bfd4b3
update c# to use new api version
jfullerton44 Sep 25, 2023
95b4710
add IdGeneration
jfullerton44 Sep 25, 2023
434119b
Update API version
jfullerton44 Sep 25, 2023
23ae4a4
first pass of typescript
jfullerton44 Sep 25, 2023
e7fadb0
Merge branch 'main' into dev/jfullerton/9-27-api
jfullerton44 Sep 25, 2023
d014511
update id gen
jfullerton44 Sep 27, 2023
97ae263
update references
jfullerton44 Sep 27, 2023
917c965
update flatten
jfullerton44 Sep 27, 2023
ddbd881
update ts contract gen
jfullerton44 Sep 27, 2023
38d9a87
update create ports
jfullerton44 Sep 28, 2023
5bcf0a3
update writer
jfullerton44 Sep 28, 2023
6282f20
update go and java
jfullerton44 Sep 28, 2023
a86d81b
update name in typescript
jfullerton44 Sep 28, 2023
eab847c
auto gen ts and cs ids
jfullerton44 Sep 28, 2023
636285b
id gen in java and go
jfullerton44 Sep 28, 2023
e02aa56
remove old files
jfullerton44 Sep 28, 2023
db05333
java and go retries
jfullerton44 Sep 28, 2023
d2295ae
update retry
jfullerton44 Sep 28, 2023
6c1b056
add endpoint query param
jfullerton44 Sep 29, 2023
6638593
fix e2e test bugs
jfullerton44 Sep 29, 2023
4af6594
use old chars
jfullerton44 Sep 29, 2023
ee68870
update request objects
jfullerton44 Sep 29, 2023
c723569
go list response
jfullerton44 Oct 2, 2023
e1eb64a
Merge branch 'main' into dev/jfullerton/9-27-api
jfullerton44 Oct 2, 2023
16d061c
update ids
jfullerton44 Oct 2, 2023
401a9b8
Merge branch 'dev/jfullerton/9-27-api' of https://github.com/microsof…
jfullerton44 Oct 2, 2023
0730303
update exports
jfullerton44 Oct 2, 2023
9f1af0f
remove unused
jfullerton44 Oct 2, 2023
f14a308
update relay ids
jfullerton44 Oct 2, 2023
7ab41f3
update tags to labels
jfullerton44 Oct 2, 2023
712a435
remove tag references
jfullerton44 Oct 2, 2023
c096ab1
fix namespace export
jfullerton44 Oct 2, 2023
e687d8d
generated contracts
jfullerton44 Oct 3, 2023
fbc669d
Merge branch 'main' of https://github.com/microsoft/dev-tunnels into …
jfullerton44 Oct 5, 2023
e4bab1f
Merge branch 'main' into dev/jfullerton/9-27-api
jfullerton44 Oct 5, 2023
807484a
update return
jfullerton44 Oct 9, 2023
c0909a1
Merge branch 'dev/jfullerton/9-27-api' of https://github.com/microsof…
jfullerton44 Oct 9, 2023
39e4573
update words
jfullerton44 Oct 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cs/src/Connections/TunnelRelayTunnelHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class TunnelRelayTunnelHost : TunnelHost, IRelayClient

private SshClientSession? hostSession;
private Uri? relayUri;
private string endpointId { get { return hostId + "-relay"; } }

/// <summary>
/// Creates a new instance of a host that connects to a tunnel via a tunnel relay.
Expand Down Expand Up @@ -92,7 +93,7 @@ public override async ValueTask DisposeAsync()

if (Tunnel != null)
{
tasks.Add(ManagementClient!.DeleteTunnelEndpointsAsync(Tunnel, this.hostId, TunnelConnectionMode.TunnelRelay));
tasks.Add(ManagementClient!.DeleteTunnelEndpointsAsync(Tunnel, endpointId));
}

foreach (RemotePortForwarder forwarder in RemoteForwarders.Values)
Expand Down Expand Up @@ -123,6 +124,7 @@ protected override async Task<ITunnelConnector> CreateTunnelConnectorAsync(Cance
var endpoint = new TunnelRelayTunnelEndpoint
{
HostId = this.hostId,
Id = this.endpointId,
HostPublicKeys = hostPublicKeys,
};
List<KeyValuePair<string, string>>? additionalQueryParams = null;
Expand Down
14 changes: 7 additions & 7 deletions cs/src/Contracts/Tunnel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public Tunnel()
/// Gets or sets the generated ID of the tunnel, unique within the cluster.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[RegularExpression(OldTunnelIdPattern)]
[StringLength(OldTunnelIdLength, MinimumLength = OldTunnelIdLength)]
[RegularExpression(NewTunnelIdPattern)]
[StringLength(NewTunnelIdMaxLength, MinimumLength = NewTunnelIdMinLength)]
public string? TunnelId { get; set; }

/// <summary>
Expand All @@ -61,13 +61,13 @@ public Tunnel()
public string? Description { get; set; }

/// <summary>
/// Gets or sets the tags of the tunnel.
/// Gets or sets the labels of the tunnel.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[MaxLength(MaxTags)]
[ArrayStringLength(TagMaxLength, MinimumLength = TagMinLength)]
[ArrayRegularExpression(TagPattern)]
public string[]? Tags { get; set; }
[MaxLength(MaxLabels)]
[ArrayStringLength(LabelMaxLength, MinimumLength = LabelMinLength)]
[ArrayRegularExpression(LabelPattern)]
public string[]? Labels { get; set; }

/// <summary>
/// Gets or sets the optional parent domain of the tunnel, if it is not using
Expand Down
36 changes: 18 additions & 18 deletions cs/src/Contracts/TunnelConstraints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ public static class TunnelConstraints
/// <summary>
/// Min length of a single tunnel or port tag.
/// </summary>
/// <seealso cref="Tunnel.Tags"/>
/// <seealso cref="TunnelPort.Tags"/>
public const int TagMinLength = 1;
/// <seealso cref="Tunnel.Labels"/>
/// <seealso cref="TunnelPort.Labels"/>
public const int LabelMinLength = 1;

/// <summary>
/// Max length of a single tunnel or port tag.
/// </summary>
/// <seealso cref="Tunnel.Tags"/>
/// <seealso cref="TunnelPort.Tags"/>
public const int TagMaxLength = 50;
/// <seealso cref="Tunnel.Labels"/>
/// <seealso cref="TunnelPort.Labels"/>
public const int LabelMaxLength = 50;

/// <summary>
/// Maximum number of tags that can be applied to a tunnel or port.
/// Maximum number of labels that can be applied to a tunnel or port.
/// </summary>
/// <seealso cref="Tunnel.Tags"/>
/// <seealso cref="TunnelPort.Tags"/>
public const int MaxTags = 100;
/// <seealso cref="Tunnel.Labels"/>
/// <seealso cref="TunnelPort.Labels"/>
public const int MaxLabels = 100;

/// <summary>
/// Min length of a tunnel domain.
Expand Down Expand Up @@ -265,17 +265,17 @@ public static class TunnelConstraints
public static Regex TunnelNameRegex { get; } = new Regex(TunnelNamePattern);

/// <summary>
/// Regular expression that can match or validate tunnel or port tags.
/// Regular expression that can match or validate tunnel or port labels.
/// </summary>
/// <seealso cref="TunnelPort.Tags"/>
public const string TagPattern = "[\\w-=]{1,50}";
/// <seealso cref="TunnelPort.Labels"/>
public const string LabelPattern = "[\\w-=]{1,50}";

/// <summary>
/// Regular expression that can match or validate tunnel or port tags.
/// Regular expression that can match or validate tunnel or port labels.
/// </summary>
/// <seealso cref="Tunnel.Tags"/>
/// <seealso cref="TunnelPort.Tags"/>
public static Regex TagRegex { get; } = new Regex(TagPattern);
/// <seealso cref="Tunnel.Labels"/>
/// <seealso cref="TunnelPort.Labels"/>
public static Regex LabelRegex { get; } = new Regex(LabelPattern);

/// <summary>
/// Regular expression that can match or validate tunnel domains.
Expand Down Expand Up @@ -422,7 +422,7 @@ public static bool IsValidTag(string tag)
return false;
}

var m = TagRegex.Match(tag);
var m = LabelRegex.Match(tag);
return m.Index == 0 && m.Length == tag.Length;
}

Expand Down
2 changes: 1 addition & 1 deletion cs/src/Contracts/TunnelListByRegion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class TunnelListByRegion
/// List of tunnels.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public TunnelV2[]? Value { get; set; }
public Tunnel[]? Value { get; set; }

/// <summary>
/// Error detail if getting list of tunnels in the region failed.
Expand Down
37 changes: 0 additions & 37 deletions cs/src/Contracts/TunnelListResponse.cs

This file was deleted.

14 changes: 7 additions & 7 deletions cs/src/Contracts/TunnelPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public TunnelPort()
/// Gets or sets the generated ID of the tunnel, unique within the cluster.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[RegularExpression(OldTunnelIdPattern)]
[StringLength(OldTunnelIdLength, MinimumLength = OldTunnelIdLength)]
[RegularExpression(NewTunnelIdPattern)]
[StringLength(NewTunnelIdMaxLength, MinimumLength = NewTunnelIdMinLength)]
public string? TunnelId { get; set; }

/// <summary>
Expand All @@ -64,13 +64,13 @@ public TunnelPort()
public string? Description { get; set; }

/// <summary>
/// Gets or sets the tags of the port.
/// Gets or sets the labels of the port.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[MaxLength(MaxTags)]
[ArrayStringLength(TagMaxLength, MinimumLength = TagMinLength)]
[ArrayRegularExpression(TagPattern)]
public string[]? Tags { get; set; }
[MaxLength(MaxLabels)]
[ArrayStringLength(LabelMaxLength, MinimumLength = LabelMinLength)]
[ArrayRegularExpression(LabelPattern)]
public string[]? Labels { get; set; }

/// <summary>
/// Gets or sets the protocol of the tunnel port.
Expand Down
4 changes: 2 additions & 2 deletions cs/src/Contracts/TunnelPortListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ public class TunnelPortListResponse
/// </summary>
public TunnelPortListResponse()
{
Value = Array.Empty<TunnelPortV2>();
Value = Array.Empty<TunnelPort>();
}

/// <summary>
/// List of tunnels
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public TunnelPortV2[] Value { get; set; }
public TunnelPort[] Value { get; set; }

/// <summary>
/// Link to get next page of results
Expand Down
154 changes: 0 additions & 154 deletions cs/src/Contracts/TunnelPortV2.cs

This file was deleted.

Loading