forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitlab_stringdata.go
More file actions
141 lines (139 loc) · 7.59 KB
/
Copy pathgitlab_stringdata.go
File metadata and controls
141 lines (139 loc) · 7.59 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Code generated by stringdata. DO NOT EDIT.
package schema
// GitLabSchemaJSON is the content of the file "gitlab.schema.json".
const GitLabSchemaJSON = `{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "gitlab.schema.json#",
"title": "GitLabConnection",
"description": "Configuration for a connection to GitLab (GitLab.com or GitLab self-managed).",
"type": "object",
"additionalProperties": false,
"required": ["url", "token"],
"properties": {
"url": {
"description": "URL of a GitLab instance, such as https://gitlab.example.com or (for GitLab.com) https://gitlab.com.",
"type": "string",
"pattern": "^https?://",
"not": {
"type": "string",
"pattern": "example\\.com"
},
"format": "uri",
"examples": ["https://gitlab.com", "https://gitlab.example.com"]
},
"token": {
"description": "A GitLab access token with \"api\" and \"sudo\" scopes. If this token does not have \"sudo\" scope, then you must set ` + "`" + `permissions.ignore` + "`" + ` to true.",
"type": "string",
"minLength": 1
},
"gitURLType": {
"description": "The type of Git URLs to use for cloning and fetching Git repositories on this GitLab instance.\n\nIf \"http\", Sourcegraph will access GitLab repositories using Git URLs of the form http(s)://gitlab.example.com/myteam/myproject.git (using https: if the GitLab instance uses HTTPS).\n\nIf \"ssh\", Sourcegraph will access GitLab repositories using Git URLs of the form [email protected]:myteam/myproject.git. See the documentation for how to provide SSH private keys and known_hosts: https://docs.sourcegraph.com/admin/repo/auth#repositories-that-need-http-s-or-ssh-authentication.",
"type": "string",
"enum": ["http", "ssh"],
"default": "http"
},
"certificate": {
"description": "TLS certificate of a GitLab instance. To get the certificate run ` + "`" + `openssl s_client -connect HOST:443 -showcerts < /dev/null 2> /dev/null | openssl x509 -outform PEM` + "`" + `",
"type": "string",
"pattern": "^-----BEGIN CERTIFICATE-----\n"
},
"projectQuery": {
"description": "An array of strings specifying which GitLab projects to mirror on Sourcegraph. Each string is a URL query string for the GitLab projects API, such as \"?membership=true&search=foo\".\n\nThe query string is passed directly to GitLab to retrieve the list of projects. The special string \"none\" can be used as the only element to disable this feature. Projects matched by multiple query strings are only imported once. See https://docs.gitlab.com/ee/api/projects.html#list-all-projects for available query string options.",
"type": "array",
"default": ["?membership=true"],
"items": {
"type": "string"
}
},
"repositoryPathPattern": {
"description": "The pattern used to generate a the corresponding Sourcegraph repository name for a GitLab project. In the pattern, the variable \"{host}\" is replaced with the GitLab URL's host (such as gitlab.example.com), and \"{pathWithNamespace}\" is replaced with the GitLab project's \"namespace/path\" (such as \"myteam/myproject\").\n\nFor example, if your GitLab is https://gitlab.example.com and your Sourcegraph is https://src.example.com, then a repositoryPathPattern of \"{host}/{pathWithNamespace}\" would mean that a GitLab project at https://gitlab.example.com/myteam/myproject is available on Sourcegraph at https://src.example.com/gitlab.example.com/myteam/myproject.\n\nIt is important that the Sourcegraph repository name generated with this pattern be unique to this code host. If different code hosts generate repository names that collide, Sourcegraph's behavior is undefined.",
"type": "string",
"default": "{host}/{pathWithNamespace}"
},
"initialRepositoryEnablement": {
"description": "Defines whether repositories from this GitLab instance should be enabled and cloned when they are first seen by Sourcegraph. If false, the site admin must explicitly enable GitLab repositories (in the site admin area) to clone them and make them searchable on Sourcegraph. If true, they will be enabled and cloned immediately (subject to rate limiting by GitLab); site admins can still disable them explicitly, and they'll remain disabled.",
"type": "boolean"
},
"authorization": {
"title": "GitLabAuthorization",
"description": "If non-null, enforces GitLab repository permissions. This requires that there be an item in the ` + "`" + `auth.providers` + "`" + ` field of type \"gitlab\" with the same ` + "`" + `url` + "`" + ` field as specified in this ` + "`" + `GitLabConnection` + "`" + `.",
"type": "object",
"additionalProperties": false,
"required": ["identityProvider"],
"properties": {
"identityProvider": {
"description": "The source of identity to use when computing permissions. This defines how to compute the GitLab identity to use for a given Sourcegraph user.",
"type": "object",
"required": ["type"],
"properties": {
"type": {
"type": "string",
"enum": ["oauth", "username", "external"]
}
},
"oneOf": [
{ "$ref": "#/definitions/OAuthIdentity" },
{ "$ref": "#/definitions/UsernameIdentity" },
{ "$ref": "#/definitions/ExternalIdentity" }
],
"!go": {
"taggedUnionType": true
}
},
"ttl": {
"description": "The TTL of how long to cache permissions data. This is 3 hours by default.\n\nDecreasing the TTL will increase the load on the code host API. If you have X repos on your instance, it will take ~X/100 API requests to fetch the complete list for 1 user. If you have Y users, you will incur X*Y/100 API requests per cache refresh period.\n\nIf set to zero, Sourcegraph will sync a user's entire accessible repository list on every request (NOT recommended).",
"type": "string",
"default": "3h"
}
}
}
},
"definitions": {
"OAuthIdentity": {
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "oauth"
}
}
},
"UsernameIdentity": {
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "username"
}
}
},
"ExternalIdentity": {
"type": "object",
"additionalProperties": false,
"required": ["type", "authProviderID", "authProviderType", "gitlabProvider"],
"properties": {
"type": {
"type": "string",
"const": "external"
},
"authProviderID": {
"type": "string",
"description": "The value of the ` + "`" + `configID` + "`" + ` field of the targeted authentication provider."
},
"authProviderType": {
"type": "string",
"description": "The ` + "`" + `type` + "`" + ` field of the targeted authentication provider."
},
"gitlabProvider": {
"type": "string",
"description": "The name that identifies the authentication provider to GitLab. This is passed to the ` + "`" + `?provider=` + "`" + ` query parameter in calls to the GitLab Users API. If you're not sure what this value is, you can look at the ` + "`" + `identities` + "`" + ` field of the GitLab Users API result (` + "`" + `curl -H 'PRIVATE-TOKEN: $YOUR_TOKEN' $GITLAB_URL/api/v4/users` + "`" + `)."
}
}
}
}
}
`