diff --git a/docs/openapi.json b/docs/openapi.json
index bbe57bf..28fac5a 100644
--- a/docs/openapi.json
+++ b/docs/openapi.json
@@ -426,111 +426,6 @@
},
"components" : {
"schemas" : {
- "CredentialRepresentation" : {
- "type" : "object",
- "properties" : {
- "id" : {
- "type" : "string"
- },
- "type" : {
- "type" : "string"
- },
- "userLabel" : {
- "type" : "string"
- },
- "createdDate" : {
- "format" : "int64",
- "type" : "integer"
- },
- "secretData" : {
- "type" : "string"
- },
- "credentialData" : {
- "type" : "string"
- },
- "priority" : {
- "format" : "int32",
- "type" : "integer"
- },
- "value" : {
- "type" : "string"
- },
- "temporary" : {
- "type" : "boolean"
- },
- "device" : {
- "type" : "string",
- "deprecated" : true
- },
- "hashedSaltedValue" : {
- "type" : "string",
- "deprecated" : true
- },
- "salt" : {
- "type" : "string",
- "deprecated" : true
- },
- "hashIterations" : {
- "format" : "int32",
- "type" : "integer",
- "deprecated" : true
- },
- "counter" : {
- "format" : "int32",
- "type" : "integer",
- "deprecated" : true
- },
- "algorithm" : {
- "type" : "string",
- "deprecated" : true
- },
- "digits" : {
- "format" : "int32",
- "type" : "integer",
- "deprecated" : true
- },
- "period" : {
- "format" : "int32",
- "type" : "integer",
- "deprecated" : true
- },
- "config" : {
- "type" : "object",
- "additionalProperties" : {
- "type" : "string"
- },
- "deprecated" : true
- }
- }
- },
- "FederatedIdentityRepresentation" : {
- "type" : "object",
- "properties" : {
- "identityProvider" : {
- "type" : "string"
- },
- "userId" : {
- "type" : "string"
- },
- "userName" : {
- "type" : "string"
- }
- }
- },
- "SocialLinkRepresentation" : {
- "type" : "object",
- "properties" : {
- "socialProvider" : {
- "type" : "string"
- },
- "socialUserId" : {
- "type" : "string"
- },
- "socialUsername" : {
- "type" : "string"
- }
- }
- },
"TenantInvitationRepresentation" : {
"required" : [ "email", "roles" ],
"type" : "object",
@@ -571,11 +466,36 @@
"readOnly" : true
},
"user" : {
- "description" : "Returns basic user info only including id, username, creation date, names, email, enabled state, email verification and federation link.",
"type" : "object",
- "allOf" : [ {
- "$ref" : "#/components/schemas/UserRepresentation"
- } ],
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "createdTimestamp" : {
+ "type" : "number"
+ },
+ "username" : {
+ "type" : "string"
+ },
+ "enabled" : {
+ "type" : "boolean"
+ },
+ "firstName" : {
+ "type" : "string"
+ },
+ "lastName" : {
+ "type" : "string"
+ },
+ "email" : {
+ "type" : "string"
+ },
+ "emailVerified" : {
+ "type" : "boolean"
+ },
+ "federationLink" : {
+ "type" : "string"
+ }
+ },
"readOnly" : true
},
"roles" : {
@@ -603,237 +523,6 @@
"readOnly" : true
}
}
- },
- "UserConsentRepresentation" : {
- "type" : "object",
- "properties" : {
- "clientId" : {
- "type" : "string"
- },
- "grantedClientScopes" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- },
- "createdDate" : {
- "format" : "int64",
- "type" : "integer"
- },
- "lastUpdatedDate" : {
- "format" : "int64",
- "type" : "integer"
- },
- "grantedRealmRoles" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- },
- "deprecated" : true
- }
- }
- },
- "UserProfileAttributeGroupMetadata" : {
- "type" : "object",
- "properties" : {
- "name" : {
- "type" : "string"
- },
- "displayHeader" : {
- "type" : "string"
- },
- "displayDescription" : {
- "type" : "string"
- },
- "annotations" : {
- "type" : "object",
- "additionalProperties" : { }
- }
- }
- },
- "UserProfileAttributeMetadata" : {
- "type" : "object",
- "properties" : {
- "name" : {
- "type" : "string"
- },
- "displayName" : {
- "type" : "string"
- },
- "required" : {
- "type" : "boolean"
- },
- "readOnly" : {
- "type" : "boolean"
- },
- "annotations" : {
- "type" : "object",
- "additionalProperties" : { }
- },
- "validators" : {
- "type" : "object",
- "additionalProperties" : {
- "type" : "object",
- "additionalProperties" : { }
- }
- },
- "group" : {
- "type" : "string"
- }
- }
- },
- "UserProfileMetadata" : {
- "type" : "object",
- "properties" : {
- "attributes" : {
- "type" : "array",
- "items" : {
- "$ref" : "#/components/schemas/UserProfileAttributeMetadata"
- }
- },
- "groups" : {
- "type" : "array",
- "items" : {
- "$ref" : "#/components/schemas/UserProfileAttributeGroupMetadata"
- }
- }
- }
- },
- "UserRepresentation" : {
- "type" : "object",
- "properties" : {
- "self" : {
- "type" : "string"
- },
- "id" : {
- "type" : "string"
- },
- "origin" : {
- "type" : "string"
- },
- "createdTimestamp" : {
- "format" : "int64",
- "type" : "integer"
- },
- "username" : {
- "type" : "string"
- },
- "enabled" : {
- "type" : "boolean"
- },
- "totp" : {
- "type" : "boolean"
- },
- "emailVerified" : {
- "type" : "boolean"
- },
- "firstName" : {
- "type" : "string"
- },
- "lastName" : {
- "type" : "string"
- },
- "email" : {
- "type" : "string"
- },
- "federationLink" : {
- "type" : "string"
- },
- "serviceAccountClientId" : {
- "type" : "string"
- },
- "attributes" : {
- "type" : "object",
- "additionalProperties" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- }
- },
- "credentials" : {
- "type" : "array",
- "items" : {
- "$ref" : "#/components/schemas/CredentialRepresentation"
- }
- },
- "disableableCredentialTypes" : {
- "uniqueItems" : true,
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- },
- "requiredActions" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- },
- "federatedIdentities" : {
- "type" : "array",
- "items" : {
- "$ref" : "#/components/schemas/FederatedIdentityRepresentation"
- }
- },
- "realmRoles" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- },
- "clientRoles" : {
- "type" : "object",
- "additionalProperties" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- }
- },
- "clientConsents" : {
- "type" : "array",
- "items" : {
- "$ref" : "#/components/schemas/UserConsentRepresentation"
- }
- },
- "notBefore" : {
- "format" : "int32",
- "type" : "integer"
- },
- "applicationRoles" : {
- "type" : "object",
- "additionalProperties" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- },
- "deprecated" : true
- },
- "socialLinks" : {
- "type" : "array",
- "items" : {
- "$ref" : "#/components/schemas/SocialLinkRepresentation"
- },
- "deprecated" : true
- },
- "groups" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- },
- "access" : {
- "type" : "object",
- "additionalProperties" : {
- "type" : "boolean"
- }
- },
- "userProfileMetadata" : {
- "$ref" : "#/components/schemas/UserProfileMetadata"
- }
- }
}
}
}
diff --git a/docs/openapi.yaml b/docs/openapi.yaml
index c82b205..652cad9 100644
--- a/docs/openapi.yaml
+++ b/docs/openapi.yaml
@@ -290,80 +290,6 @@ paths:
type: string
components:
schemas:
- CredentialRepresentation:
- type: object
- properties:
- id:
- type: string
- type:
- type: string
- userLabel:
- type: string
- createdDate:
- format: int64
- type: integer
- secretData:
- type: string
- credentialData:
- type: string
- priority:
- format: int32
- type: integer
- value:
- type: string
- temporary:
- type: boolean
- device:
- type: string
- deprecated: true
- hashedSaltedValue:
- type: string
- deprecated: true
- salt:
- type: string
- deprecated: true
- hashIterations:
- format: int32
- type: integer
- deprecated: true
- counter:
- format: int32
- type: integer
- deprecated: true
- algorithm:
- type: string
- deprecated: true
- digits:
- format: int32
- type: integer
- deprecated: true
- period:
- format: int32
- type: integer
- deprecated: true
- config:
- type: object
- additionalProperties:
- type: string
- deprecated: true
- FederatedIdentityRepresentation:
- type: object
- properties:
- identityProvider:
- type: string
- userId:
- type: string
- userName:
- type: string
- SocialLinkRepresentation:
- type: object
- properties:
- socialProvider:
- type: string
- socialUserId:
- type: string
- socialUsername:
- type: string
TenantInvitationRepresentation:
required:
- email
@@ -397,12 +323,26 @@ components:
type: string
readOnly: true
user:
- description: "Returns basic user info only including id, username, creation\
- \ date, names, email, enabled state, email verification and federation\
- \ link."
type: object
- allOf:
- - $ref: '#/components/schemas/UserRepresentation'
+ properties:
+ id:
+ type: string
+ createdTimestamp:
+ type: number
+ username:
+ type: string
+ enabled:
+ type: boolean
+ firstName:
+ type: string
+ lastName:
+ type: string
+ email:
+ type: string
+ emailVerified:
+ type: boolean
+ federationLink:
+ type: string
readOnly: true
roles:
uniqueItems: true
@@ -422,159 +362,3 @@ components:
realm:
type: string
readOnly: true
- UserConsentRepresentation:
- type: object
- properties:
- clientId:
- type: string
- grantedClientScopes:
- type: array
- items:
- type: string
- createdDate:
- format: int64
- type: integer
- lastUpdatedDate:
- format: int64
- type: integer
- grantedRealmRoles:
- type: array
- items:
- type: string
- deprecated: true
- UserProfileAttributeGroupMetadata:
- type: object
- properties:
- name:
- type: string
- displayHeader:
- type: string
- displayDescription:
- type: string
- annotations:
- type: object
- additionalProperties: {}
- UserProfileAttributeMetadata:
- type: object
- properties:
- name:
- type: string
- displayName:
- type: string
- required:
- type: boolean
- readOnly:
- type: boolean
- annotations:
- type: object
- additionalProperties: {}
- validators:
- type: object
- additionalProperties:
- type: object
- additionalProperties: {}
- group:
- type: string
- UserProfileMetadata:
- type: object
- properties:
- attributes:
- type: array
- items:
- $ref: '#/components/schemas/UserProfileAttributeMetadata'
- groups:
- type: array
- items:
- $ref: '#/components/schemas/UserProfileAttributeGroupMetadata'
- UserRepresentation:
- type: object
- properties:
- self:
- type: string
- id:
- type: string
- origin:
- type: string
- createdTimestamp:
- format: int64
- type: integer
- username:
- type: string
- enabled:
- type: boolean
- totp:
- type: boolean
- emailVerified:
- type: boolean
- firstName:
- type: string
- lastName:
- type: string
- email:
- type: string
- federationLink:
- type: string
- serviceAccountClientId:
- type: string
- attributes:
- type: object
- additionalProperties:
- type: array
- items:
- type: string
- credentials:
- type: array
- items:
- $ref: '#/components/schemas/CredentialRepresentation'
- disableableCredentialTypes:
- uniqueItems: true
- type: array
- items:
- type: string
- requiredActions:
- type: array
- items:
- type: string
- federatedIdentities:
- type: array
- items:
- $ref: '#/components/schemas/FederatedIdentityRepresentation'
- realmRoles:
- type: array
- items:
- type: string
- clientRoles:
- type: object
- additionalProperties:
- type: array
- items:
- type: string
- clientConsents:
- type: array
- items:
- $ref: '#/components/schemas/UserConsentRepresentation'
- notBefore:
- format: int32
- type: integer
- applicationRoles:
- type: object
- additionalProperties:
- type: array
- items:
- type: string
- deprecated: true
- socialLinks:
- type: array
- items:
- $ref: '#/components/schemas/SocialLinkRepresentation'
- deprecated: true
- groups:
- type: array
- items:
- type: string
- access:
- type: object
- additionalProperties:
- type: boolean
- userProfileMetadata:
- $ref: '#/components/schemas/UserProfileMetadata'
diff --git a/pom.xml b/pom.xml
index f827e5d..a8e057d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -181,8 +181,6 @@
${project.name}
${project.version}
{{keycloakUrl}}/auth/realms/{{realmName}}
- provided
- dev.sultanov.keycloak.multitenancy.resource,org.keycloak.representations.idm
/tenants
diff --git a/src/main/java/dev/sultanov/keycloak/multitenancy/resource/representation/TenantMembershipRepresentation.java b/src/main/java/dev/sultanov/keycloak/multitenancy/resource/representation/TenantMembershipRepresentation.java
index 23866cf..aeb851b 100644
--- a/src/main/java/dev/sultanov/keycloak/multitenancy/resource/representation/TenantMembershipRepresentation.java
+++ b/src/main/java/dev/sultanov/keycloak/multitenancy/resource/representation/TenantMembershipRepresentation.java
@@ -2,7 +2,9 @@
import java.util.Set;
import lombok.Data;
+import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
+import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty;
import org.keycloak.representations.idm.UserRepresentation;
@Schema
@@ -12,7 +14,18 @@ public class TenantMembershipRepresentation {
@Schema(readOnly = true)
private String id;
- @Schema(readOnly = true, description = "Returns basic user info only including id, username, creation date, names, email, enabled state, email verification and federation link.")
+ @Schema(readOnly = true,
+ properties = {
+ @SchemaProperty(name = "id", type = SchemaType.STRING),
+ @SchemaProperty(name = "createdTimestamp", type = SchemaType.NUMBER),
+ @SchemaProperty(name = "username", type = SchemaType.STRING),
+ @SchemaProperty(name = "enabled", type = SchemaType.BOOLEAN),
+ @SchemaProperty(name = "firstName", type = SchemaType.STRING),
+ @SchemaProperty(name = "lastName", type = SchemaType.STRING),
+ @SchemaProperty(name = "email", type = SchemaType.STRING),
+ @SchemaProperty(name = "emailVerified", type = SchemaType.BOOLEAN),
+ @SchemaProperty(name = "federationLink", type = SchemaType.STRING)
+ })
private UserRepresentation user;
@Schema(required = true)