feat(integerations): add route to get user details (#4030)
* feat(integerations): add route to get user details * Commit updated API documentation * test(integrations): implement unit test for get user details --------- Co-authored-by: Owncast <owncast@owncast.online> Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// Package generated provides primitives to interact with the openapi HTTP API.
|
||||
//
|
||||
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT.
|
||||
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
|
||||
package generated
|
||||
|
||||
import (
|
||||
@@ -503,14 +503,6 @@ type StreamOutputVariant struct {
|
||||
VideoPassthrough *bool `json:"videoPassthrough,omitempty"`
|
||||
}
|
||||
|
||||
// SystemActionEvent defines model for SystemActionEvent.
|
||||
type SystemActionEvent struct {
|
||||
Body *string `json:"body,omitempty"`
|
||||
Id *string `json:"id,omitempty"`
|
||||
Timestamp *string `json:"timestamp,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// SystemMessage defines model for SystemMessage.
|
||||
type SystemMessage struct {
|
||||
Body *string `json:"body,omitempty"`
|
||||
@@ -1088,16 +1080,16 @@ type RegisterAnonymousChatUserJSONRequestBody RegisterAnonymousChatUserJSONBody
|
||||
type UpdateUserEnabledJSONRequestBody UpdateUserEnabledJSONBody
|
||||
|
||||
// SendChatActionJSONRequestBody defines body for SendChatAction for application/json ContentType.
|
||||
type SendChatActionJSONRequestBody = SystemActionEvent
|
||||
type SendChatActionJSONRequestBody = MessageEvent
|
||||
|
||||
// ExternalUpdateMessageVisibilityJSONRequestBody defines body for ExternalUpdateMessageVisibility for application/json ContentType.
|
||||
type ExternalUpdateMessageVisibilityJSONRequestBody = MessageVisibilityUpdate
|
||||
|
||||
// SendIntegrationChatMessageJSONRequestBody defines body for SendIntegrationChatMessage for application/json ContentType.
|
||||
type SendIntegrationChatMessageJSONRequestBody = UserMessage
|
||||
type SendIntegrationChatMessageJSONRequestBody = MessageEvent
|
||||
|
||||
// SendSystemMessageJSONRequestBody defines body for SendSystemMessage for application/json ContentType.
|
||||
type SendSystemMessageJSONRequestBody = SystemMessage
|
||||
type SendSystemMessageJSONRequestBody = MessageEvent
|
||||
|
||||
// SendSystemMessageToConnectedClientJSONRequestBody defines body for SendSystemMessageToConnectedClient for application/json ContentType.
|
||||
type SendSystemMessageToConnectedClientJSONRequestBody = SystemMessage
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/owncast/owncast/models"
|
||||
"github.com/owncast/owncast/webserver/handlers/admin"
|
||||
"github.com/owncast/owncast/webserver/handlers/moderation"
|
||||
"github.com/owncast/owncast/webserver/router/middleware"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
@@ -67,6 +68,10 @@ func (*ServerInterfaceImpl) ExternalSetStreamTitleOptions(w http.ResponseWriter,
|
||||
middleware.RequireExternalAPIAccessToken(models.ScopeHasAdminAccess, admin.ExternalSetStreamTitle)(w, r)
|
||||
}
|
||||
|
||||
func (*ServerInterfaceImpl) ExternalGetUserDetails(w http.ResponseWriter, r *http.Request, userId string) {
|
||||
middleware.RequireExternalAPIAccessToken(models.ScopeHasAdminAccess, moderation.ExternalGetUserDetails)(w, r)
|
||||
}
|
||||
|
||||
func (*ServerInterfaceImpl) ExternalGetChatMessages(w http.ResponseWriter, r *http.Request) {
|
||||
middleware.RequireExternalAPIAccessToken(models.ScopeHasAdminAccess, ExternalGetChatMessages)(w, r)
|
||||
}
|
||||
|
||||
@@ -74,3 +74,7 @@ func GetUserDetails(w http.ResponseWriter, r *http.Request) {
|
||||
utils.InternalErrorHandler(w, err)
|
||||
}
|
||||
}
|
||||
|
||||
func ExternalGetUserDetails(integration models.ExternalAPIUser, w http.ResponseWriter, r *http.Request) {
|
||||
GetUserDetails(w, r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user