sdk_golang

package module
v0.19.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

README

Ziti SDK for Golang

Ziti is a modern, programmable network overlay with associated edge components, for application-embedded, zero trust network connectivity, written by developers for developers. Ziti allows developers to take control of networking while with secure connectivity and advanced security concepts such as Zero Trust.

This repository contains the Ziti SDK for golang.

Enrollment

Prerequisite: Ziti Enrollment token in JWT format (e.g. device.jwt)

Run enrollment process to generate SDK configuration file -- device.json

$ ziti-enroller -jwt device.jwt -out device.json

Note: additional options (-cert, -key, -engine) are available to enroll with ottCa and CA methods

Using SDK

SDK is using ZITI_SDK_CONFIG environment variable to load configuration file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpClient

func NewHttpClient(ctx ziti.Context, tlsConfig *tls.Config) *http.Client

NewHttpClient returns a http.Client that can be used exactly as any other http.Client but will route requests over a Ziti network using the host name as the Ziti service name. Supplying a tlsConfig is possible to connect to HTTPS services, but for it to be successful, the Ziti service name MUST be in the servers URI SANs.

Types

type ZitiTransport

type ZitiTransport struct {
	http.Transport

	Context   ziti.Context
	TlsConfig *tls.Config
	// contains filtered or unexported fields
}

ZitiTransport wraps the default http.RoundTripper implementation with Ziti edge.Conn pooling

func NewZitiTransport

func NewZitiTransport(ctx ziti.Context, clientTlsConfig *tls.Config) *ZitiTransport

NewZitiTransport returns a new http.Transport that routes HTTP requests and response over a Ziti network.

func (*ZitiTransport) DialContext

func (transport *ZitiTransport) DialContext(ctx context.Context, network, addr string) (net.Conn, error)

func (*ZitiTransport) DialTLSContext

func (transport *ZitiTransport) DialTLSContext(ctx context.Context, network, addr string) (net.Conn, error)

Directories

Path Synopsis
example module
exercises
Package ziti provides methods for loading ziti contexts from identity JSON files Identity files specifies in `ZITI_IDENTITIES` environment variable (semicolon separates) are loaded automatically at startup
Package ziti provides methods for loading ziti contexts from identity JSON files Identity files specifies in `ZITI_IDENTITIES` environment variable (semicolon separates) are loaded automatically at startup

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL