Skip to content

Commit

Permalink
Access Control Entry Expiration (#327)
Browse files Browse the repository at this point in the history
* adding expiration to access control

* adding access control expiraiton

* update go version

* adding access control entry expiraiton

---------

Co-authored-by: Utsa Santhosh <[email protected]>
  • Loading branch information
usanth and Utsa Santhosh authored Oct 4, 2023
1 parent 7dec065 commit 70c632f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cs/src/Contracts/TunnelAccessControlEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ public TunnelAccessControlEntry()
[ArrayStringLength(TunnelAccessScopes.MaxLength)]
public string[] Scopes { get; set; }

/// <summary>
/// Gets or sets the expiration for an access control entry.
/// </summary>
/// <remarks>
/// If no value is set then this value is null.
/// </remarks>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? Expiration { get; set; }

/// <summary>
/// Gets a compact textual representation of the access control entry.
/// </summary>
Expand Down
9 changes: 9 additions & 0 deletions go/tunnels/tunnel_access_control_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

package tunnels

import (
"time"
)

// Data contract for an access control entry on a `Tunnel` or `TunnelPort`.
//
// An access control entry (ACE) grants or denies one or more access scopes to one or more
Expand Down Expand Up @@ -68,6 +72,11 @@ type TunnelAccessControlEntry struct {
//
// These must be one or more values from `TunnelAccessScopes`.
Scopes []string `json:"scopes"`

// Gets or sets the expiration for an access control entry.
//
// If no value is set then this value is null.
Expiration *time.Time `json:"expiration,omitempty"`
}

// Constants for well-known identity providers.
Expand Down
2 changes: 1 addition & 1 deletion go/tunnels/tunnels.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/rodaine/table"
)

const PackageVersion = "0.0.24"
const PackageVersion = "0.0.25"

func (tunnel *Tunnel) requestObject() (*Tunnel, error) {
convertedTunnel := &Tunnel{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package com.microsoft.tunnels.contracts;

import com.google.gson.annotations.Expose;
import java.util.Date;

/**
* Data contract for an access control entry on a {@link Tunnel} or {@link TunnelPort}.
Expand Down Expand Up @@ -99,6 +100,14 @@ public class TunnelAccessControlEntry {
@Expose
public String[] scopes;

/**
* Gets or sets the expiration for an access control entry.
*
* If no value is set then this value is null.
*/
@Expose
public Date expiration;

/**
* Constants for well-known identity providers.
*/
Expand Down
6 changes: 6 additions & 0 deletions rs/src/contracts/tunnel_access_control_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license.
// Generated from ../../../cs/src/Contracts/TunnelAccessControlEntry.cs

use chrono::{DateTime, Utc};
use crate::contracts::TunnelAccessControlEntryType;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -77,6 +78,11 @@ pub struct TunnelAccessControlEntry {
//
// These must be one or more values from `TunnelAccessScopes`.
pub scopes: Vec<String>,

// Gets or sets the expiration for an access control entry.
//
// If no value is set then this value is null.
pub expiration: Option<DateTime<Utc>>,
}

// Constants for well-known identity providers.
Expand Down
7 changes: 7 additions & 0 deletions ts/src/contracts/tunnelAccessControlEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ export interface TunnelAccessControlEntry {
* These must be one or more values from {@link TunnelAccessScopes}.
*/
scopes: string[];

/**
* Gets or sets the expiration for an access control entry.
*
* If no value is set then this value is null.
*/
expiration?: Date;
}

namespace TunnelAccessControlEntry {
Expand Down

0 comments on commit 70c632f

Please sign in to comment.