Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 13 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 19 additions & 7 deletions .github/actions/compute-next-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ name: Compute the next version for a release track
# moment a stable release is tagged the next beta computation rolls forward
# automatically. No shared state file is needed.
#
# The major version (vX) is read from the module path in go.mod, so a major
# bump (for example the /v2 -> /v3 module move) needs no change here: whatever
# major the module declares is the major this action releases against.
#

inputs:
track:
Expand All @@ -33,15 +37,23 @@ runs:
set -euo pipefail
git fetch --tags --quiet

# Only consider clean stable tags on the current major line (v2.MINOR.PATCH).
# The strict anchored regex excludes other majors (v1.*), any prerelease
# suffix (-beta/-alpha/-rc/...), and stray non-release tags. `sort -V`
# orders by semver so double-digit minors (v2.10.0 > v2.9.0) sort right.
# `|| true` keeps a no-match grep (exit 1) from aborting the step under
# Derive the current major (vX) from the module path in go.mod so this
# action never needs editing across a major bump. A go.mod path ends in
# `/vN` from v2 onward; a v0/v1 module has no suffix, which maps to v1.
MODULE=$(awk '/^module / {print $2; exit}' go.mod)
MAJOR=$(printf '%s\n' "${MODULE}" | grep -oE '/v[0-9]+$' | tr -d '/v' || true)
MAJOR=${MAJOR:-1}
echo "::notice::compute-next-version: module=${MODULE} major=v${MAJOR}"

# Only consider clean stable tags on the current major line (vX.MINOR.PATCH).
# The strict anchored regex excludes other majors, any prerelease suffix
# (-beta/-alpha/-rc/...), and stray non-release tags. `sort -V` orders by
# semver so double-digit minors (vX.10.0 > vX.9.0) sort right. `|| true`
# keeps a no-match grep (exit 1) from aborting the step under
# `set -euo pipefail`; the explicit emptiness check below handles it.
LATEST_STABLE=$(git tag --list | grep -E '^v2\.[0-9]+\.[0-9]+$' | sort -V | tail -1 || true)
LATEST_STABLE=$(git tag --list | grep -E "^v${MAJOR}\.[0-9]+\.[0-9]+$" | sort -V | tail -1 || true)
if [ -z "${LATEST_STABLE}" ]; then
echo "::error::No stable v2.MINOR.PATCH tag found; cannot compute next version." >&2
echo "::error::No stable v${MAJOR}.MINOR.PATCH tag found; cannot compute next version." >&2
exit 1
fi

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
check-latest: true
Expand All @@ -28,7 +28,7 @@ jobs:
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}

- name: Update codecov report
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # pin@6.0.1
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # pin@7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
# Checkout the code
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: Scan for Vulnerabilities in Code
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # pin@1.0.4
uses: golang/govulncheck-action@032d45514ae346b1db93c04b0c90b841c370344f # pin@1.1.0
with:
go-version-file: go.mod
go-package: ./...
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
check-latest: true
Expand All @@ -23,7 +23,7 @@ jobs:
run: go build ./...

- name: Check for linting errors
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # pin@9.2.1
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # pin@9.3.0
with:
version: latest
args: -v -c .golangci.yml . ./authentication/... ./internal/...
Expand All @@ -33,10 +33,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
check-latest: true
Expand All @@ -45,7 +45,7 @@ jobs:
run: make test

- name: Update codecov report
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # pin@6.0.1
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # pin@7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ make test-e2e # Run tests against real Auth0 tenant

> Applies only when working on the `beta` branch.

This SDK ships two tracks from one module path (`github.com/auth0/go-auth0/v2`):
This SDK ships two tracks from one module path (`github.com/auth0/go-auth0/v3`):

- **Stable** (`main`): EA/GA endpoints only. Released by a maintainer via a `release/*` branch.
- **Beta** (`beta`): a superset of stable plus beta-only endpoints. Released automatically when a PR is merged into `beta`.
Expand All @@ -178,7 +178,7 @@ The `beta` branch is **regenerated** from the stable spec plus the beta-only spe

### Versioning

Beta = the next stable minor + `-beta.N`, derived from git tags. Latest stable `v2.13.0` -> beta `v2.14.0-beta.N`; `-beta.N` starts at 0 per base and auto-increments; once stable `v2.14.0` ships, beta rolls to `v2.15.0-beta.0`. No state file.
Beta = the next stable minor + `-beta.N`, derived from git tags. Latest stable `v3.1.0` -> beta `v3.2.0-beta.N`; `-beta.N` starts at 0 per base and auto-increments; once stable `v3.2.0` ships, beta rolls to `v3.3.0-beta.0`. No state file.

### When merging a beta regeneration PR

Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This SDK is auto-generated from Auth0's OpenAPI specifications. Most of the mana
> This section applies only on the `beta` branch.

The SDK ships two parallel tracks from one Go module path
(`github.com/auth0/go-auth0/v2`):
(`github.com/auth0/go-auth0/v3`):

- **Stable** (`main` branch): EA/GA endpoints only. Released the usual way, by a maintainer, through a `release/*` branch.
- **Beta** (`beta` branch): a superset that contains everything in stable **plus** beta-only endpoints. Released automatically whenever a PR is merged into `beta`.
Expand All @@ -40,10 +40,10 @@ Consumers opt into beta explicitly; a plain `go get` never selects it:

```sh
# Stable (default): always resolves to the latest stable release.
go get github.com/auth0/go-auth0/v2
go get github.com/auth0/go-auth0/v3

# Beta: explicit prerelease pin.
go get github.com/auth0/go-auth0/v2@v2.14.0-beta.0
go get github.com/auth0/go-auth0/v3@v3.2.0-beta.0
```

### How beta stays a superset of stable
Expand All @@ -63,12 +63,12 @@ be opened as separate PRs to **both** `main` and `beta`.
Beta always carries the **next** stable minor with a `-beta.N` suffix, derived
entirely from the git tags (no state file):

- Latest stable `v2.13.0` -> beta is `v2.14.0-beta.N`.
- Latest stable `v3.1.0` -> beta is `v3.2.0-beta.N`.
- `-beta.N` starts at 0 for each new base and auto-increments on each beta release.
- The moment stable `v2.14.0` is tagged, the next beta automatically becomes
`v2.15.0-beta.0`.
- The moment stable `v3.2.0` is tagged, the next beta automatically becomes
`v3.3.0-beta.0`.

Because `v2.14.0-beta.2` sorts before `v2.14.0` in semver, beta is never picked
Because `v3.2.0-beta.2` sorts before `v3.2.0` in semver, beta is never picked
up by `go get` unless pinned.

### Merging a beta regeneration PR
Expand Down
32 changes: 16 additions & 16 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Examples

This guide provides comprehensive examples for using the Auth0 Go SDK v2, covering authentication, management operations, pagination, and advanced usage patterns.
This guide provides comprehensive examples for using the Auth0 Go SDK v3, covering authentication, management operations, pagination, and advanced usage patterns.

## Table of Contents

Expand All @@ -15,16 +15,16 @@ This guide provides comprehensive examples for using the Auth0 Go SDK v2, coveri

## Client Credentials Authentication

The SDK v2 provides several ways to authenticate with Auth0 using OAuth client credentials through the options pattern.
The SDK v3 provides several ways to authenticate with Auth0 using OAuth client credentials through the options pattern.

### Management API Initialization

```go
import (
"context"
"github.com/auth0/go-auth0/v2/management"
"github.com/auth0/go-auth0/v2/management/client"
"github.com/auth0/go-auth0/v2/management/option"
"github.com/auth0/go-auth0/v3/management"
"github.com/auth0/go-auth0/v3/management/client"
"github.com/auth0/go-auth0/v3/management/option"
"golang.org/x/oauth2"
)

Expand Down Expand Up @@ -100,7 +100,7 @@ mgmt, err := client.New(
```go
import (
"context"
"github.com/auth0/go-auth0/v2/authentication"
"github.com/auth0/go-auth0/v3/authentication"
)

// With client secret authentication
Expand All @@ -122,7 +122,7 @@ auth, err := authentication.New(

## Request Options

v2 provides fine-grained configuration through request options that can be applied to individual requests.
v3 provides fine-grained configuration through request options that can be applied to individual requests.

### Basic Request Options

Expand Down Expand Up @@ -208,7 +208,7 @@ connections, err := mgmt.Connections.List(ctx, connectionListRequest)

## Pagination

The SDK v2 uses a `Page` type for pagination with built-in iterator support.
The SDK v3 uses a `Page` type for pagination with built-in iterator support.

### Page-based Pagination

Expand Down Expand Up @@ -520,9 +520,9 @@ import (
"fmt"
"log"

"github.com/auth0/go-auth0/v2/management"
"github.com/auth0/go-auth0/v2/management/client"
"github.com/auth0/go-auth0/v2/management/option"
"github.com/auth0/go-auth0/v3/management"
"github.com/auth0/go-auth0/v3/management/client"
"github.com/auth0/go-auth0/v3/management/option"
)

func main() {
Expand All @@ -543,7 +543,7 @@ func main() {

// Create a new client application
createRequest := &management.CreateClientRequestContent{
Name: "My Go SDK v2 App",
Name: "My Go SDK v3 App",
AppType: &management.ClientAppTypeEnumSpa,
Callbacks: []string{
"http://localhost:3000/callback",
Expand Down Expand Up @@ -625,9 +625,9 @@ import (
"fmt"
"log"

"github.com/auth0/go-auth0/v2/management"
"github.com/auth0/go-auth0/v2/management/client"
"github.com/auth0/go-auth0/v2/management/option"
"github.com/auth0/go-auth0/v3/management"
"github.com/auth0/go-auth0/v3/management/client"
"github.com/auth0/go-auth0/v3/management/option"
)

func main() {
Expand Down Expand Up @@ -714,4 +714,4 @@ func main() {
}
```

These examples demonstrate the key patterns for using the Auth0 Go SDK v2 effectively. The SDK's type-safe approach and built-in pagination support make it easier to work with Auth0's Management API while providing flexibility for advanced use cases.
These examples demonstrate the key patterns for using the Auth0 Go SDK v3 effectively. The SDK's type-safe approach and built-in pagination support make it easier to work with Auth0's Management API while providing flexibility for advanced use cases.
Loading
Loading