Skip to content

Commit

Permalink
Merge pull request #344 from openziti/identity-onOff-cmdline-fmt
Browse files Browse the repository at this point in the history
Identity on off cmdline fmt
  • Loading branch information
mary-dcouto authored Apr 7, 2021
2 parents 0f6e179 + c1d3b3d commit 0273259
Show file tree
Hide file tree
Showing 22 changed files with 801 additions and 802 deletions.
2 changes: 1 addition & 1 deletion service/cziti/ctun.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,4 @@ Set-NetIPInterface -InterfaceIndex $i.ifIndex -InterfaceMetric %d`, interfaceNam
if err != nil {
log.Errorf("ERROR setting interface metric: %v", err)
}
}
}
16 changes: 9 additions & 7 deletions service/cziti/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ func ziti_mfa_cb_verify_go(_ C.ziti_context, status C.int, cFingerprint *C.char)
fp := C.GoString(cFingerprint)
log.Debugf("ziti_mfa_cb_verify_go called for %s. status: %d for ", fp, int(status))
var m = dto.MfaEvent{
ActionEvent: dto.MFAEnrollmentVerificationEvent,
Fingerprint: fp,
Successful: false,
ActionEvent: dto.MFAEnrollmentVerificationEvent,
Fingerprint: fp,
Successful: false,
RecoveryCodes: nil,
}

Expand All @@ -135,6 +135,7 @@ func ziti_mfa_cb_verify_go(_ C.ziti_context, status C.int, cFingerprint *C.char)
}

var rtnCodes = make(chan mfaCodes)

func ReturnMfaCodes(id *ZIdentity, code string) ([]string, error) {
ccode := C.CString(code)
defer C.free(unsafe.Pointer(ccode))
Expand Down Expand Up @@ -179,6 +180,7 @@ func ziti_mfa_recovery_codes_cb_return(_ C.ziti_context, status C.int, recoveryC
}

var genCodes = make(chan mfaCodes)

func GenerateMfaCodes(id *ZIdentity, code string) ([]string, error) {
ccode := C.CString(code)
defer C.free(unsafe.Pointer(ccode))
Expand Down Expand Up @@ -292,9 +294,9 @@ func ziti_mfa_cb_remove_go(_ C.ziti_context, status C.int, cFingerprint *C.char)

log.Debugf("ziti_mfa_cb_remove_go called for %s. status: %d for ", fp, int(status))
var m = dto.MfaEvent{
ActionEvent: dto.MFAEnrollmentRemovedEvent,
Fingerprint: fp,
Successful: false,
ActionEvent: dto.MFAEnrollmentRemovedEvent,
Fingerprint: fp,
Successful: false,
RecoveryCodes: nil,
}

Expand All @@ -311,4 +313,4 @@ func ziti_mfa_cb_remove_go(_ C.ziti_context, status C.int, cFingerprint *C.char)

log.Debugf("sending ziti_mfa_verify response back to UI for %s. verified: %t. error: %s", fp, m.Successful, m.Error)
goapi.BroadcastEvent(m)
}
}
2 changes: 1 addition & 1 deletion service/cziti/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ func eventCB(ztx C.ziti_context, event *C.ziti_event_t) {

var m = dto.IdentityEvent{
ActionEvent: dto.IdentityUpdateComplete,
Id: dto.Identity{
Id: dto.Identity{
FingerPrint: zid.Fingerprint,
},
}
Expand Down
110 changes: 55 additions & 55 deletions service/ziti-tunnel/cli/constants.go
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
package cli

/*
* Copyright NetFoundry, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

import (
"github.com/openziti/desktop-edge-win/service/ziti-tunnel/dto"
"github.com/openziti/desktop-edge-win/service/ziti-tunnel/util/logging"
)

var GET_STATUS = dto.CommandMsg{
Function: "Status",
}

var ONOFF_IDENTITY = dto.CommandMsg{
Function: "IdentityOnOff",
}

var SET_LOGLEVEL = dto.CommandMsg{
Function: "SetLogLevel",
}

var NOTIFY_LOGLEVEL_UI_MONITOR = dto.CommandMsg{
Function: "NotifyLogLevelUIAndUpdateService",
}

var NOTIFY_IDENTITY_UI = dto.CommandMsg{
Function: "NotifyIdentityUI",
}

var monitorIpcPipe = `\\.\pipe\OpenZiti\ziti-monitor\ipc`

var templateIdentity = `{{printf "%40s" "Name"}} | {{printf "%41s" "FingerPrint"}} | {{printf "%6s" "Active"}} | {{printf "%30s" "Config"}} | {{"Status"}}
{{range .}}{{printf "%40s" .Name}} | {{printf "%41s" .FingerPrint}} | {{printf "%6t" .Active}} | {{printf "%30s" .Config}} | {{.Status}}
{{end}}`

var templateService = `{{printf "%40s" "Name"}} | {{printf "%15s" "Id"}} | {{printf "%9s" "Protocols"}} | {{printf "%14s" "Ports"}} | {{printf "%40s" "Addresses"}} | {{"OwnsIntercept"}}
{{range .}}{{printf "%40s" .Name}} | {{printf "%15s" .Id}} | {{printf "%9s" .Protocols}} | {{printf "%14s" .Ports}} | {{printf "%40s" .Addresses}} | {{.OwnsIntercept}}
{{end}}`

var log = logging.Logger()
package cli

/*
* Copyright NetFoundry, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

import (
"github.com/openziti/desktop-edge-win/service/ziti-tunnel/dto"
"github.com/openziti/desktop-edge-win/service/ziti-tunnel/util/logging"
)

var GET_STATUS = dto.CommandMsg{
Function: "Status",
}

var ONOFF_IDENTITY = dto.CommandMsg{
Function: "IdentityOnOff",
}

var SET_LOGLEVEL = dto.CommandMsg{
Function: "SetLogLevel",
}

var NOTIFY_LOGLEVEL_UI_MONITOR = dto.CommandMsg{
Function: "NotifyLogLevelUIAndUpdateService",
}

var NOTIFY_IDENTITY_UI = dto.CommandMsg{
Function: "NotifyIdentityUI",
}

var monitorIpcPipe = `\\.\pipe\OpenZiti\ziti-monitor\ipc`

var templateIdentity = `{{printf "%40s" "Name"}} | {{printf "%41s" "FingerPrint"}} | {{printf "%6s" "Active"}} | {{printf "%30s" "Config"}} | {{"Status"}}
{{range .}}{{printf "%40s" .Name}} | {{printf "%41s" .FingerPrint}} | {{printf "%6t" .Active}} | {{printf "%30s" .Config}} | {{.Status}}
{{end}}`

var templateService = `{{printf "%40s" "Name"}} | {{printf "%15s" "Id"}} | {{printf "%9s" "Protocols"}} | {{printf "%14s" "Ports"}} | {{printf "%40s" "Addresses"}} | {{"OwnsIntercept"}}
{{range .}}{{printf "%40s" .Name}} | {{printf "%15s" .Id}} | {{printf "%9s" .Protocols}} | {{printf "%14s" .Ports}} | {{printf "%40s" .Addresses}} | {{.OwnsIntercept}}
{{end}}`

var log = logging.Logger()
Loading

0 comments on commit 0273259

Please sign in to comment.