Skip to content

Commit

Permalink
GATE-4074: Adds support for the new Protocol Detection feature in tea…
Browse files Browse the repository at this point in the history
…ms-accounts
  • Loading branch information
Michael Borkenstein committed Jul 19, 2023
1 parent b8dab62 commit cea3365
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .changelog/1340.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
teams-accounts: Adds support for protocol detection
```
17 changes: 11 additions & 6 deletions teams_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ type TeamsConfiguration struct {
}

type TeamsAccountSettings struct {
Antivirus *TeamsAntivirus `json:"antivirus,omitempty"`
TLSDecrypt *TeamsTLSDecrypt `json:"tls_decrypt,omitempty"`
ActivityLog *TeamsActivityLog `json:"activity_log,omitempty"`
BlockPage *TeamsBlockPage `json:"block_page,omitempty"`
BrowserIsolation *BrowserIsolation `json:"browser_isolation,omitempty"`
FIPS *TeamsFIPS `json:"fips,omitempty"`
Antivirus *TeamsAntivirus `json:"antivirus,omitempty"`
TLSDecrypt *TeamsTLSDecrypt `json:"tls_decrypt,omitempty"`
ActivityLog *TeamsActivityLog `json:"activity_log,omitempty"`
BlockPage *TeamsBlockPage `json:"block_page,omitempty"`
BrowserIsolation *BrowserIsolation `json:"browser_isolation,omitempty"`
FIPS *TeamsFIPS `json:"fips,omitempty"`
ProtocolDetection *TeamsProtocolDetection `json:"protocol_detection,omitempty"`
}

type BrowserIsolation struct {
Expand All @@ -62,6 +63,10 @@ type TeamsTLSDecrypt struct {
Enabled bool `json:"enabled"`
}

type TeamsProtocolDetection struct {
Enabled bool `json:"enabled"`
}

type TeamsActivityLog struct {
Enabled bool `json:"enabled"`
}
Expand Down
22 changes: 15 additions & 7 deletions teams_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ func TestTeamsAccountConfiguration(t *testing.T) {
"tls_decrypt": {
"enabled": true
},
"protocol_detection": {
"enabled": true
},
"fips": {
"tls": true
},
Expand Down Expand Up @@ -88,10 +91,11 @@ func TestTeamsAccountConfiguration(t *testing.T) {

if assert.NoError(t, err) {
assert.Equal(t, actual.Settings, TeamsAccountSettings{
Antivirus: &TeamsAntivirus{EnabledDownloadPhase: true},
ActivityLog: &TeamsActivityLog{Enabled: true},
TLSDecrypt: &TeamsTLSDecrypt{Enabled: true},
FIPS: &TeamsFIPS{TLS: true},
Antivirus: &TeamsAntivirus{EnabledDownloadPhase: true},
ActivityLog: &TeamsActivityLog{Enabled: true},
TLSDecrypt: &TeamsTLSDecrypt{Enabled: true},
ProtocolDetection: &TeamsProtocolDetection{Enabled: true},
FIPS: &TeamsFIPS{TLS: true},

BlockPage: &TeamsBlockPage{
Enabled: BoolPtr(true),
Expand Down Expand Up @@ -129,6 +133,9 @@ func TestTeamsAccountUpdateConfiguration(t *testing.T) {
},
"activity_log": {
"enabled": true
},
"protocol_detection": {
"enabled": true
}
}
}
Expand All @@ -137,9 +144,10 @@ func TestTeamsAccountUpdateConfiguration(t *testing.T) {
}

settings := TeamsAccountSettings{
Antivirus: &TeamsAntivirus{EnabledDownloadPhase: false},
ActivityLog: &TeamsActivityLog{Enabled: true},
TLSDecrypt: &TeamsTLSDecrypt{Enabled: true},
Antivirus: &TeamsAntivirus{EnabledDownloadPhase: false},
ActivityLog: &TeamsActivityLog{Enabled: true},
TLSDecrypt: &TeamsTLSDecrypt{Enabled: true},
ProtocolDetection: &TeamsProtocolDetection{Enabled: true},
}

mux.HandleFunc("/accounts/"+testAccountID+"/gateway/configuration", handler)
Expand Down

0 comments on commit cea3365

Please sign in to comment.