You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+97Lines changed: 97 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,103 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [v1.5.0] - 2025-10-28
9
+
10
+
### 🚨 Breaking Changes
11
+
12
+
This release removes the `github.com/google/go-github/v74` dependency and implements a lightweight internal GitHub API client. While most users will experience no breaking changes, some API adjustments have been made:
13
+
14
+
#### API Changes
15
+
16
+
1.**Enterprise Configuration Simplified**
17
+
-**Before**: `WithEnterpriseURLs(baseURL, uploadURL string)` - required both base and upload URLs
18
+
-**After**: `WithEnterpriseURL(baseURL string)` - single base URL parameter
19
+
-**Migration**: Remove the redundant upload URL parameter
20
+
21
+
2.**Type Changes** (if you were using these types directly)
Copy file name to clipboardExpand all lines: README.md
+55-8Lines changed: 55 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
`go-githubauth` is a Go package that provides utilities for GitHub authentication, including generating and using GitHub App tokens, installation tokens, and personal access tokens.
10
10
11
-
**v1.4.x**introduces personal access token support and significant performance optimizations with intelligent token caching and high-performance HTTP clients.
11
+
**v1.5.0**removes the `go-github` dependency, implementing a lightweight internal GitHub API client. This reduces external dependencies while maintaining full compatibility with the OAuth2 token source interface.
12
12
13
13
---
14
14
@@ -26,15 +26,17 @@
26
26
27
27
`go-githubauth` package provides implementations of the `TokenSource` interface from the `golang.org/x/oauth2` package. This interface has a single method, Token, which returns an *oauth2.Token.
-**🔐 Personal Access Token Support**: Native support for both classic and fine-grained personal access tokens
32
33
-**⚡ Token Caching**: Dual-layer caching system for optimal performance
33
34
- JWT tokens cached until expiration (up to 10 minutes)
34
35
- Installation tokens cached until expiration (defined by GitHub response)
35
36
-**🚀 Pooled HTTP Client**: Production-ready HTTP client with connection pooling
36
37
-**📈 Performance Optimizations**: Up to 99% reduction in unnecessary GitHub API calls
37
38
-**🏗️ Production Ready**: Optimized for high-throughput and enterprise applications
39
+
-**🌐 Simplified Enterprise Support**: Streamlined configuration with single base URL parameter
38
40
39
41
### Core Capabilities
40
42
@@ -48,7 +50,9 @@
48
50
49
51
### Requirements
50
52
53
+
- Go 1.21 or higher (for generics support)
51
54
- This package is designed to be used with the `golang.org/x/oauth2` package
55
+
- No external GitHub SDK dependencies required
52
56
53
57
## Installation
54
58
@@ -60,7 +64,9 @@ go get -u github.com/jferrl/go-githubauth
60
64
61
65
## Usage
62
66
63
-
### Usage with [go-github](https://github.com/google/go-github) and [oauth2](golang.org/x/oauth2)
67
+
### Usage with [oauth2](golang.org/x/oauth2)
68
+
69
+
You can use this package standalone with any HTTP client, or integrate it with the [go-github](https://github.com/google/go-github) SDK if you need additional GitHub API functionality.
64
70
65
71
#### Client ID (Recommended)
66
72
@@ -73,7 +79,7 @@ import (
73
79
"os"
74
80
"strconv"
75
81
76
-
"github.com/google/go-github/v74/github"
82
+
"github.com/google/go-github/v76/github"
77
83
"github.com/jferrl/go-githubauth"
78
84
"golang.org/x/oauth2"
79
85
)
@@ -117,7 +123,7 @@ import (
117
123
"os"
118
124
"strconv"
119
125
120
-
"github.com/google/go-github/v74/github"
126
+
"github.com/google/go-github/v76/github"
121
127
"github.com/jferrl/go-githubauth"
122
128
"golang.org/x/oauth2"
123
129
)
@@ -274,7 +280,48 @@ func main() {
274
280
275
281
GitHub Personal Access Tokens provide direct authentication for users and organizations. This package supports both classic personal access tokens and fine-grained personal access tokens.
276
282
277
-
#### Using Personal Access Tokens with [go-github](https://github.com/google/go-github)
283
+
#### Using Personal Access Tokens
284
+
285
+
##### With oauth2 Client (Standalone)
286
+
287
+
```go
288
+
package main
289
+
290
+
import (
291
+
"context"
292
+
"fmt"
293
+
"io"
294
+
"net/http"
295
+
"os"
296
+
297
+
"github.com/jferrl/go-githubauth"
298
+
"golang.org/x/oauth2"
299
+
)
300
+
301
+
funcmain() {
302
+
// Personal access token from environment variable
303
+
token:= os.Getenv("GITHUB_TOKEN") // e.g., "ghp_..." or "github_pat_..."
1.**Classic Personal Access Token**: Visit [GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)](https://github.com/settings/tokens)
317
364
2.**Fine-grained Personal Access Token**: Visit [GitHub Settings > Developer settings > Personal access tokens > Fine-grained tokens](https://github.com/settings/personal-access-tokens/new)
318
365
319
-
**🔐 Security Note**: Store your personal access tokens securely and never commit them to version control. Use environment variables or secure credential management systems.
366
+
**🔐 Security Note**: Store your personal access tokens securely and never commit them to version control. Use environment variables or secure credential management systems.
0 commit comments