Skip to content

Commit 21fb01d

Browse files
committed
Remove contacts from the data model
1 parent 4ccce4d commit 21fb01d

19 files changed

+407
-76
lines changed

crates/data-model/src/oauth2/client.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ pub struct Client {
4949
/// declaring that it will restrict itself to using.
5050
pub grant_types: Vec<GrantType>,
5151

52-
/// Array of e-mail addresses of people responsible for this Client
53-
pub contacts: Vec<String>,
54-
5552
/// Name of the Client to be presented to the End-User
5653
pub client_name: Option<String>, // TODO: translations
5754

@@ -141,7 +138,6 @@ impl Client {
141138
],
142139
response_types: vec![OAuthAuthorizationEndpointResponseType::Code],
143140
grant_types: vec![GrantType::AuthorizationCode, GrantType::RefreshToken],
144-
contacts: vec!["[email protected]".to_owned()],
145141
client_name: Some("Client 1".to_owned()),
146142
client_uri: Some(Url::parse("https://client1.example.com").unwrap()),
147143
logo_uri: Some(Url::parse("https://client1.example.com/logo.png").unwrap()),
@@ -165,7 +161,6 @@ impl Client {
165161
redirect_uris: vec![Url::parse("https://client2.example.com/redirect").unwrap()],
166162
response_types: vec![OAuthAuthorizationEndpointResponseType::Code],
167163
grant_types: vec![GrantType::AuthorizationCode, GrantType::RefreshToken],
168-
contacts: vec!["[email protected]".to_owned()],
169164
client_name: None,
170165
client_uri: None,
171166
logo_uri: None,

crates/handlers/src/graphql/model/oauth.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,6 @@ impl OAuth2Client {
182182
&self.0.redirect_uris
183183
}
184184

185-
/// List of contacts advertised by the client.
186-
pub async fn contacts(&self) -> &[String] {
187-
&self.0.contacts
188-
}
189-
190185
/// The application type advertised by the client.
191186
pub async fn application_type(&self) -> Option<OAuth2ApplicationType> {
192187
match self.0.application_type.as_ref()? {

crates/handlers/src/graphql/tests.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ async fn create_test_client(state: &TestState) -> Client {
3838
None,
3939
None,
4040
vec![],
41-
vec![],
4241
None,
4342
None,
4443
None,
@@ -358,7 +357,6 @@ async fn test_oauth2_client_credentials(pool: PgPool) {
358357
let request =
359358
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
360359
"client_uri": "https://example.com/",
361-
"contacts": ["[email protected]"],
362360
"token_endpoint_auth_method": "client_secret_post",
363361
"grant_types": ["client_credentials"],
364362
}));
@@ -582,7 +580,6 @@ async fn test_add_user(pool: PgPool) {
582580
let request =
583581
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
584582
"client_uri": "https://example.com/",
585-
"contacts": ["[email protected]"],
586583
"token_endpoint_auth_method": "client_secret_post",
587584
"grant_types": ["client_credentials"],
588585
}));

crates/handlers/src/oauth2/device/authorize.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ mod tests {
181181
let request =
182182
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
183183
"client_uri": "https://example.com/",
184-
"contacts": ["[email protected]"],
185184
"token_endpoint_auth_method": "none",
186185
"grant_types": ["urn:ietf:params:oauth:grant-type:device_code"],
187186
"response_types": [],

crates/handlers/src/oauth2/introspection.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ mod tests {
477477

478478
// Provision a client which will be used to do introspection requests
479479
let request = Request::post(OAuth2RegistrationEndpoint::PATH).json(json!({
480-
"contacts": ["[email protected]"],
481480
"client_uri": "https://introspecting.com/",
482481
"grant_types": [],
483482
"token_endpoint_auth_method": "client_secret_basic",
@@ -491,7 +490,6 @@ mod tests {
491490

492491
// Provision a client which will be used to generate tokens
493492
let request = Request::post(OAuth2RegistrationEndpoint::PATH).json(json!({
494-
"contacts": ["[email protected]"],
495493
"client_uri": "https://client.com/",
496494
"redirect_uris": ["https://client.com/"],
497495
"response_types": ["code"],
@@ -683,7 +681,6 @@ mod tests {
683681

684682
// Provision a client which will be used to do introspection requests
685683
let request = Request::post(OAuth2RegistrationEndpoint::PATH).json(json!({
686-
"contacts": ["[email protected]"],
687684
"client_uri": "https://introspecting.com/",
688685
"grant_types": [],
689686
"token_endpoint_auth_method": "client_secret_basic",

crates/handlers/src/oauth2/registration.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ pub(crate) async fn post(
263263
metadata.application_type.clone(),
264264
//&metadata.response_types(),
265265
metadata.grant_types().to_vec(),
266-
metadata.contacts.clone().unwrap_or_default(),
267266
metadata
268267
.client_name
269268
.clone()
@@ -362,7 +361,6 @@ mod tests {
362361
let request =
363362
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
364363
"application_type": "web",
365-
"contacts": ["[email protected]"],
366364
"client_uri": "https://example.com/",
367365
"redirect_uris": ["http://this-is-insecure.com/"],
368366
}));
@@ -375,7 +373,6 @@ mod tests {
375373
// Incoherent response types
376374
let request =
377375
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
378-
"contacts": ["[email protected]"],
379376
"client_uri": "https://example.com/",
380377
"redirect_uris": ["https://example.com/"],
381378
"response_types": ["id_token"],
@@ -390,7 +387,6 @@ mod tests {
390387
// Using a public suffix
391388
let request =
392389
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
393-
"contacts": ["[email protected]"],
394390
"client_uri": "https://github.io/",
395391
"redirect_uris": ["https://github.io/"],
396392
"response_types": ["code"],
@@ -410,7 +406,6 @@ mod tests {
410406
// Using a public suffix in a translated URL
411407
let request =
412408
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
413-
"contacts": ["[email protected]"],
414409
"client_uri": "https://example.com/",
415410
"client_uri#fr-FR": "https://github.io/",
416411
"redirect_uris": ["https://example.com/"],
@@ -438,7 +433,6 @@ mod tests {
438433
// secret
439434
let request =
440435
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
441-
"contacts": ["[email protected]"],
442436
"client_uri": "https://example.com/",
443437
"redirect_uris": ["https://example.com/"],
444438
"response_types": ["code"],
@@ -455,7 +449,6 @@ mod tests {
455449
// return a client secret
456450
let request =
457451
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
458-
"contacts": ["[email protected]"],
459452
"client_uri": "https://example.com/",
460453
"redirect_uris": ["https://example.com/"],
461454
"response_types": ["code"],

crates/handlers/src/oauth2/revoke.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ mod tests {
250250
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
251251
"client_uri": "https://example.com/",
252252
"redirect_uris": ["https://example.com/callback"],
253-
"contacts": ["[email protected]"],
254253
"token_endpoint_auth_method": "client_secret_post",
255254
"response_types": ["code"],
256255
"grant_types": ["authorization_code", "refresh_token"],

crates/handlers/src/oauth2/token.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,6 @@ mod tests {
801801
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
802802
"client_uri": "https://example.com/",
803803
"redirect_uris": ["https://example.com/callback"],
804-
"contacts": ["[email protected]"],
805804
"token_endpoint_auth_method": "none",
806805
"response_types": ["code"],
807806
"grant_types": ["authorization_code"],
@@ -1011,7 +1010,6 @@ mod tests {
10111010
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
10121011
"client_uri": "https://example.com/",
10131012
"redirect_uris": ["https://example.com/callback"],
1014-
"contacts": ["[email protected]"],
10151013
"token_endpoint_auth_method": "none",
10161014
"response_types": ["code"],
10171015
"grant_types": ["authorization_code", "refresh_token"],
@@ -1133,7 +1131,6 @@ mod tests {
11331131
let request =
11341132
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
11351133
"client_uri": "https://example.com/",
1136-
"contacts": ["[email protected]"],
11371134
"token_endpoint_auth_method": "client_secret_post",
11381135
"grant_types": ["client_credentials"],
11391136
}));
@@ -1260,7 +1257,6 @@ mod tests {
12601257
let request =
12611258
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
12621259
"client_uri": "https://example.com/",
1263-
"contacts": ["[email protected]"],
12641260
"token_endpoint_auth_method": "none",
12651261
"grant_types": ["urn:ietf:params:oauth:grant-type:device_code", "refresh_token"],
12661262
"response_types": [],
@@ -1447,7 +1443,6 @@ mod tests {
14471443
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
14481444
"client_uri": "https://example.com/",
14491445
"redirect_uris": ["https://example.com/callback"],
1450-
"contacts": ["[email protected]"],
14511446
"token_endpoint_auth_method": "client_secret_post",
14521447
"grant_types": ["password"],
14531448
"response_types": [],

crates/handlers/src/test_utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ impl TestState {
277277
let request =
278278
Request::post(mas_router::OAuth2RegistrationEndpoint::PATH).json(serde_json::json!({
279279
"client_uri": "https://example.com/",
280-
"contacts": ["[email protected]"],
281280
"token_endpoint_auth_method": "client_secret_post",
282281
"grant_types": ["client_credentials"],
283282
}));

crates/storage-pg/.sqlx/query-199819516dce285771a75a48a687b285225aeae7a4d1ca91084ae84f25dcbbec.json

Lines changed: 134 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)