import { schema } from '@kbn/config-schema' ; import { RouteDependencies } from '../../plugin' ; export function registerOAuthAuthorizeRoute ( { router , enterpriseSearchRequestHandler , } ) { router . get ( { path : '/internal/workplace_search/oauth/authorize' , validate : { query : schema . object ( { access_type : schema . maybe ( schema . string ( ) ) , client_id : schema . string ( ) , code_challenge : schema . maybe ( schema . string ( ) ) , code_challenge_method : schema . maybe ( schema . string ( ) ) , response_type : schema . string ( ) , response_mode : schema . maybe ( schema . string ( ) ) , redirect_uri : schema . maybe ( schema . string ( ) ) , scope : schema . maybe ( schema . string ( ) ) , state : schema . nullable ( schema . string ( ) ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/oauth/authorize' , } ) ) ; } export function registerOAuthAuthorizeAcceptRoute ( { router , enterpriseSearchRequestHandler , } ) { router . post ( { path : '/internal/workplace_search/oauth/authorize' , validate : { body : schema . object ( { client_id : schema . string ( ) , response_type : schema . string ( ) , redirect_uri : schema . maybe ( schema . string ( ) ) , scope : schema . maybe ( schema . string ( ) ) , state : schema . nullable ( schema . string ( ) ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/oauth/authorize' , } ) ) ; } export function registerOAuthAuthorizeDenyRoute ( { router , enterpriseSearchRequestHandler , } ) { router . delete ( { path : '/internal/workplace_search/oauth/authorize' , validate : { body : schema . object ( { client_id : schema . string ( ) , response_type : schema . string ( ) , redirect_uri : schema . maybe ( schema . string ( ) ) , scope : schema . maybe ( schema . string ( ) ) , state : schema . nullable ( schema . string ( ) ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/oauth/authorize' , } ) ) ; } export const registerOAuthRoutes = ( dependencies ) => { registerOAuthAuthorizeRoute ( dependencies ) ; registerOAuthAuthorizeAcceptRoute ( dependencies ) ; registerOAuthAuthorizeDenyRoute ( dependencies ) ; } ;