Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/public-api/go/config/config.go
2500 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package config
6
7
import (
8
"github.com/gitpod-io/gitpod/common-go/baseserver"
9
)
10
11
type Configuration struct {
12
// PublicURL is the URL under which the API server is publicly reachable
13
PublicURL string `json:"publicURL"`
14
15
GitpodServiceURL string `json:"gitpodServiceUrl"`
16
17
BillingServiceAddress string `json:"billingServiceAddress,omitempty"`
18
19
// Address to use for creating new sessions
20
SessionServiceAddress string `json:"sessionServiceAddress"`
21
22
// StripeWebhookSigningSecretPath is a filepath to a secret used to validate incoming webhooks from Stripe
23
StripeWebhookSigningSecretPath string `json:"stripeWebhookSigningSecretPath"`
24
25
// Path to file which contains personal access token singing key
26
PersonalAccessTokenSigningKeyPath string `json:"personalAccessTokenSigningKeyPath"`
27
28
// Path to directory containing database configuration files
29
DatabaseConfigPath string `json:"databaseConfigPath"`
30
31
// Redis configures the connection to Redis
32
Redis RedisConfiguration `json:"redis"`
33
34
// Authentication configuration
35
Auth AuthConfiguration `json:"auth"`
36
37
Server *baseserver.Configuration `json:"server,omitempty"`
38
}
39
40
type RedisConfiguration struct {
41
42
// Address configures the redis connection of this component
43
Address string `json:"address"`
44
}
45
46
type AuthConfiguration struct {
47
PKI AuthPKIConfiguration `json:"pki"`
48
Session SessionConfig `json:"session"`
49
}
50
51
type SessionConfig struct {
52
LifetimeSeconds int64 `json:"lifetimeSeconds"`
53
Issuer string `json:"issuer"`
54
Cookie CookieConfig `json:"cookie"`
55
}
56
57
type CookieConfig struct {
58
Name string `json:"name"`
59
MaxAge int64 `json:"maxAge"`
60
SameSite string `json:"sameSite"`
61
Secure bool `json:"secure"`
62
HTTPOnly bool `json:"httpOnly"`
63
}
64
65
type AuthPKIConfiguration struct {
66
Signing KeyPair `json:"signing"`
67
Validating []KeyPair `json:"validating"`
68
}
69
70
type KeyPair struct {
71
ID string `json:"id"`
72
PublicKeyPath string `json:"publicKeyPath"`
73
PrivateKeyPath string `json:"privateKeyPath"`
74
}
75
76