Skip to content

Commit b35bc8e

Browse files
authored
ENG-3487: Tenant-scoped IdPs (#158)
* update domain for tenantId on IdPs (#153) * IdP search updates * add tenantId to equals and hashCode (#155) * add tenantId to IdP lookup by managed domain response
1 parent 33c2154 commit b35bc8e

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/main/java/io/fusionauth/domain/api/identityProvider/LookupResponse.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2023, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2018-2025, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,6 +41,7 @@ public LookupResponse() {
4141
public LookupResponse(BaseIdentityProvider<?> identityProvider) {
4242
this.identityProvider = new IdentityProviderDetails();
4343
this.identityProvider.id = identityProvider.id;
44+
this.identityProvider.tenantId = identityProvider.tenantId;
4445
this.identityProvider.name = identityProvider.name;
4546
this.identityProvider.type = identityProvider.getType();
4647
// Add all enabled application Ids
@@ -81,6 +82,8 @@ public static class IdentityProviderDetails {
8182

8283
public IdentityProviderOauth2Configuration oauth2;
8384

85+
public UUID tenantId;
86+
8487
public IdentityProviderType type;
8588
}
8689
}

src/main/java/io/fusionauth/domain/provider/BaseIdentityProvider.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2023, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2018-2025, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -58,6 +58,8 @@ public abstract class BaseIdentityProvider<D extends BaseIdentityProviderApplica
5858

5959
public Map<UUID, IdentityProviderTenantConfiguration> tenantConfiguration = new HashMap<>();
6060

61+
public UUID tenantId;
62+
6163
@Override
6264
public boolean equals(Object o) {
6365
if (this == o) {
@@ -79,14 +81,15 @@ public boolean equals(Object o) {
7981
Objects.equals(lastUpdateInstant, that.lastUpdateInstant) &&
8082
linkingStrategy == that.linkingStrategy &&
8183
Objects.equals(name, that.name) &&
84+
Objects.equals(tenantId, that.tenantId) &&
8285
Objects.equals(tenantConfiguration, that.tenantConfiguration);
8386
}
8487

8588
public abstract IdentityProviderType getType();
8689

8790
@Override
8891
public int hashCode() {
89-
return Objects.hash(super.hashCode(), data, applicationConfiguration, debug, id, insertInstant, lambdaConfiguration, lastUpdateInstant, linkingStrategy, name, tenantConfiguration);
92+
return Objects.hash(super.hashCode(), data, applicationConfiguration, debug, id, insertInstant, lambdaConfiguration, lastUpdateInstant, linkingStrategy, name, tenantId, tenantConfiguration);
9093
}
9194

9295
@JsonIgnore

src/main/java/io/fusionauth/domain/provider/IdentityProviderType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2019, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2018-2025, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/io/fusionauth/domain/search/IdentityProviderSearchCriteria.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2023-2025, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,6 +37,8 @@ public class IdentityProviderSearchCriteria extends BaseSearchCriteria {
3737

3838
public String name;
3939

40+
public UUID tenantId;
41+
4042
public IdentityProviderType type;
4143

4244
@JacksonConstructor
@@ -69,6 +71,7 @@ protected String defaultOrderBy() {
6971
SortableFields.put("insertInstant", "insert_instant");
7072
SortableFields.put("name", "name");
7173
SortableFields.put("enabled", "enabled");
74+
SortableFields.put("tenantId", "tenants_id");
7275
SortableFields.put("type", "type");
7376
}
7477
}

0 commit comments

Comments
 (0)