@@ -1027,3 +1027,106 @@ public struct ListUsersPaginatedResponse: Hashable, Sendable {
10271027// public static let emailChangeCurrent = GenerateLinkType(rawValue: "email_change_current")
10281028// public static let emailChangeNew = GenerateLinkType(rawValue: "email_change_new")
10291029//}
1030+
1031+ // MARK: - OAuth Client Types
1032+
1033+ /// OAuth client grant types supported by the OAuth 2.1 server.
1034+ /// Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1035+ public enum OAuthClientGrantType : String , Codable , Hashable , Sendable {
1036+ case authorizationCode = " authorization_code "
1037+ case refreshToken = " refresh_token "
1038+ }
1039+
1040+ /// OAuth client response types supported by the OAuth 2.1 server.
1041+ /// Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1042+ public enum OAuthClientResponseType : String , Codable , Hashable , Sendable {
1043+ case code
1044+ }
1045+
1046+ /// OAuth client type indicating whether the client can keep credentials confidential.
1047+ /// Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1048+ public enum OAuthClientType : String , Codable , Hashable , Sendable {
1049+ case `public`
1050+ case confidential
1051+ }
1052+
1053+ /// OAuth client registration type.
1054+ /// Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1055+ public enum OAuthClientRegistrationType : String , Codable , Hashable , Sendable {
1056+ case dynamic
1057+ case manual
1058+ }
1059+
1060+ /// OAuth client object returned from the OAuth 2.1 server.
1061+ /// Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1062+ public struct OAuthClient : Codable , Hashable , Sendable {
1063+ /// Unique identifier for the OAuth client
1064+ public let clientId : String
1065+ /// Human-readable name of the OAuth client
1066+ public let clientName : String
1067+ /// Client secret (only returned on registration and regeneration)
1068+ public let clientSecret : String ?
1069+ /// Type of OAuth client
1070+ public let clientType : OAuthClientType
1071+ /// Token endpoint authentication method
1072+ public let tokenEndpointAuthMethod : String
1073+ /// Registration type of the client
1074+ public let registrationType : OAuthClientRegistrationType
1075+ /// URI of the OAuth client
1076+ public let clientUri : String ?
1077+ /// Array of allowed redirect URIs
1078+ public let redirectUris : [ String ]
1079+ /// Array of allowed grant types
1080+ public let grantTypes : [ OAuthClientGrantType ]
1081+ /// Array of allowed response types
1082+ public let responseTypes : [ OAuthClientResponseType ]
1083+ /// Scope of the OAuth client
1084+ public let scope : String ?
1085+ /// Timestamp when the client was created
1086+ public let createdAt : Date
1087+ /// Timestamp when the client was last updated
1088+ public let updatedAt : Date
1089+ }
1090+
1091+ /// Parameters for creating a new OAuth client.
1092+ /// Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1093+ public struct CreateOAuthClientParams : Encodable , Hashable , Sendable {
1094+ /// Human-readable name of the OAuth client
1095+ public let clientName : String
1096+ /// URI of the OAuth client
1097+ public let clientUri : String ?
1098+ /// Array of allowed redirect URIs
1099+ public let redirectUris : [ String ]
1100+ /// Array of allowed grant types (optional, defaults to authorization_code and refresh_token)
1101+ public let grantTypes : [ OAuthClientGrantType ] ?
1102+ /// Array of allowed response types (optional, defaults to code)
1103+ public let responseTypes : [ OAuthClientResponseType ] ?
1104+ /// Scope of the OAuth client
1105+ public let scope : String ?
1106+
1107+ public init (
1108+ clientName: String ,
1109+ clientUri: String ? = nil ,
1110+ redirectUris: [ String ] ,
1111+ grantTypes: [ OAuthClientGrantType ] ? = nil ,
1112+ responseTypes: [ OAuthClientResponseType ] ? = nil ,
1113+ scope: String ? = nil
1114+ ) {
1115+ self . clientName = clientName
1116+ self . clientUri = clientUri
1117+ self . redirectUris = redirectUris
1118+ self . grantTypes = grantTypes
1119+ self . responseTypes = responseTypes
1120+ self . scope = scope
1121+ }
1122+ }
1123+
1124+ /// Response type for listing OAuth clients.
1125+ /// Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1126+ public struct ListOAuthClientsPaginatedResponse : Hashable , Sendable {
1127+ public let clients : [ OAuthClient ]
1128+ public let aud : String
1129+ public var nextPage : Int ?
1130+ public var lastPage : Int
1131+ public var total : Int
1132+ }
0 commit comments