Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.
/ sase-go Public archive

SDK for interacting with Secure Access Edge Service

License

Notifications You must be signed in to change notification settings

PaloAltoNetworks/sase-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

sase-go

SDK for interacting with Secure Access Edge Service

GoDoc

Package sase is a golang SDK for interacting with the Palo Alto Networks Secure Access Edge Service.

NOTE: Use the new paloaltonetworks/scm-go repo instead.

Using sase-go

To start, create a client connection, then invoke Setup(), and retrieve the JWT with RefreshJwt(). JWTs expire after some time, but the SDK will catch the failed auth and automatically refresh the JWT when a 401 is returned from the API:

package main

import (
    "context"
    "log"

    "github.com/paloaltonetworks/sase-go"
)

func main() {
    var err error
    ctx := context.TODO()

    con := sase.Client{
        ClientId: "1234-56-78-9",
        ClientSecret: "a-b-c-d",
        Scope: "tsg_id:123456789",
        CheckEnvironment: true,
    }

    if err = con.Setup(); err != nil {
        log.Fatal(err)
    } else if err = con.RefreshJwt(ctx); err != nil {
        log.Fatal(err)
    }

    log.Printf("Authenticated ok")
}

About

SDK for interacting with Secure Access Edge Service

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages