-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfig.go
More file actions
26 lines (22 loc) · 1.03 KB
/
config.go
File metadata and controls
26 lines (22 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Package githubapp provides GitHub App authentication and token management.
package githubapp
import "time"
// Config represents the configuration for a single GitHub App.
type Config struct {
Name string `hcl:"name,label" help:"Name for this GitHub App configuration."`
AppID string `hcl:"app-id,optional" help:"GitHub App ID"`
PrivateKeyPath string `hcl:"private-key-path,optional" help:"Path to GitHub App private key (PEM format)"`
Installations map[string]string `hcl:"installations,optional" help:"Mapping of org names to installation IDs"`
}
// TokenCacheConfig configures token caching behavior.
type TokenCacheConfig struct {
RefreshBuffer time.Duration // How early to refresh before expiration
JWTExpiration time.Duration // GitHub allows max 10 minutes
}
// DefaultTokenCacheConfig returns default token cache configuration.
func DefaultTokenCacheConfig() TokenCacheConfig {
return TokenCacheConfig{
RefreshBuffer: 5 * time.Minute,
JWTExpiration: 10 * time.Minute,
}
}