Skip to content

Commit fd22475

Browse files
AlexTugarevroboquat
authored andcommitted
[iam] Add proto definitions for OIDC provider config
1 parent 2f48822 commit fd22475

File tree

6 files changed

+3033
-0
lines changed

6 files changed

+3033
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
syntax = "proto3";
2+
3+
package gitpod.experimental.v1;
4+
5+
option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/experimental/v1";
6+
7+
import "google/protobuf/timestamp.proto";
8+
9+
import "gitpod/experimental/v1/pagination.proto";
10+
11+
message OIDCConfig {
12+
// URL using the https scheme with no query or fragment component that the
13+
// OIDC provider asserts as its Issuer Identifier. Required.
14+
string issuer = 1;
15+
16+
// A KeySet that can validate the id_token (JSON web token)
17+
// Either one is required.
18+
string jwks = 2;
19+
string jwks_url = 3;
20+
21+
// Optional.
22+
ConsentScreenHints hints = 4;
23+
24+
// If set, the default claim mapping is overriden.
25+
// Optional.
26+
ClaimMappingOverride override_claim_mapping = 5;
27+
}
28+
29+
message ConsentScreenHints {
30+
// Control options for the consent screen.
31+
// Optional.
32+
string prompt = 1;
33+
// A hint to pre-select the tenant from an AD.
34+
// Optional.
35+
string domain_hint = 2;
36+
// Optional.
37+
string login_hint = 3;
38+
}
39+
40+
message ClaimMappingOverride {
41+
// Optional.
42+
string claim_email_key = 1;
43+
// Optional.
44+
string claim_groups_key = 2;
45+
// Optional.
46+
string claim_username_key = 3;
47+
}
48+
49+
message OAuth2Config {
50+
// Required.
51+
string client_id = 1;
52+
// Required.
53+
string client_secret = 2;
54+
// Required.
55+
string authorization_endpoint = 3;
56+
// Required.
57+
string token_endpoint = 4;
58+
// Required.
59+
repeated string scopes_supported = 5;
60+
61+
// Source for additional claims for the token.
62+
// Required.
63+
string userinfo_endpoint = 6;
64+
65+
// Optional.
66+
UserInfoKeys userinfo_keys = 7;
67+
}
68+
69+
message UserInfoKeys {
70+
// Optional.
71+
string userinfo_id_key = 1;
72+
// Optional.
73+
string userinfo_name_key = 2;
74+
}
75+
76+
// Configuration of an OpenID provider instance.
77+
//
78+
// For the metadata describing the configuration of OIDC providers, cf.
79+
// https://openid.net/specs/openid-connect-discovery-1_0.html
80+
message OIDCClientConfig {
81+
// ID is the unique identifier for the OIDC Config.
82+
// Read only.
83+
string id = 1;
84+
85+
OIDCConfig oidc_config = 2;
86+
87+
OAuth2Config oauth2_config = 3;
88+
// Optional.
89+
bool oauth_only = 4;
90+
91+
// List of the JWS signing algorithms (alg values) supported by the OP for the
92+
// ID Token to encode the Claims in a JWT. The algorithm RS256 MUST be
93+
// included. Optional.
94+
repeated string id_token_signing_alg_values_supported = 5;
95+
96+
// Time when the config was created.
97+
// Read-only.
98+
google.protobuf.Timestamp creation_time = 6;
99+
100+
// Read-only.
101+
OIDCClientStatus status = 7;
102+
}
103+
104+
message OIDCClientStatus {
105+
//
106+
}
107+
108+
service OIDCService {
109+
// Creates a new OIDC client configuration.
110+
rpc CreateClientConfig(CreateClientConfigRequest)
111+
returns (CreateClientConfigResponse) {};
112+
113+
// Retrieves an OIDC client configuration by ID.
114+
rpc GetClientConfig(GetClientConfigRequest)
115+
returns (GetClientConfigResponse) {};
116+
117+
// Lists OIDC client configurations.
118+
rpc ListClientConfigs(ListClientConfigsRequest)
119+
returns (ListClientConfigsResponse) {};
120+
121+
// Updates modifiable properties of an existing OIDC provider configuration.
122+
rpc UpdateClientConfig(UpdateClientConfigRequest)
123+
returns (UpdateClientConfigResponse) {};
124+
125+
// Removes a OIDC provider configuration by ID.
126+
rpc DeleteClientConfig(DeleteClientConfigRequest)
127+
returns (DeleteClientConfigResponse) {};
128+
}
129+
130+
message CreateClientConfigRequest {
131+
OIDCClientConfig config = 1;
132+
133+
// Optional.
134+
bool use_discovery = 2;
135+
}
136+
137+
message CreateClientConfigResponse { OIDCClientConfig config = 1; }
138+
139+
message GetClientConfigRequest { string id = 1; }
140+
message GetClientConfigResponse { OIDCClientConfig config = 1; }
141+
142+
message ListClientConfigsRequest {
143+
144+
// Page information
145+
Pagination pagination = 1;
146+
}
147+
148+
message ListClientConfigsResponse {
149+
repeated OIDCClientConfig providers = 1;
150+
151+
int64 total_results = 2;
152+
}
153+
154+
message UpdateClientConfigRequest { OIDCClientConfig config = 1; }
155+
156+
message UpdateClientConfigResponse {}
157+
158+
message DeleteClientConfigRequest { string id = 1; }
159+
160+
message DeleteClientConfigResponse {}

0 commit comments

Comments
 (0)