Skip to content

Commit

Permalink
feat: add admin access to UI websocket connection
Browse files Browse the repository at this point in the history
feat: add admin access to user data services
  • Loading branch information
iryabov committed Dec 13, 2023
1 parent 35cb5a3 commit 4c09d54
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fun Route.authWebSocket(
val tokenService by di().instance<TokenService>()

authenticate("jwt") {
withRole(Role.USER) {
withRole(Role.USER, Role.ADMIN) {
webSocket(path, protocol) {
socketAuthentication(tokenService)
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AgentEndpoints(override val di: DI) : DIAware {
app.routing {

authenticate("jwt", "basic") {
withRole(Role.USER) {
withRole(Role.USER, Role.ADMIN) {
post<ApiRoot.Agents, AgentCreationDto>(
"Create agent"
.examples(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DrillAdminEndpoints(override val di: DI) : DIAware {
app.routing {

authenticate("jwt", "basic") {
withRole(Role.USER) {
withRole(Role.USER, Role.ADMIN) {
post<ApiRoot.Agents.ToggleAgent>(
"Agent Toggle StandBy"
.responds(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ internal class PluginDispatcher(override val di: DI) : DIAware {
}
}
authenticate("jwt", "basic") {
withRole(Role.USER) {
withRole(Role.USER, Role.ADMIN) {
post<ApiRoot.Agents.DispatchPluginAction, String>(
"Dispatch Plugin Action"
.examples(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class GroupHandler(override val di: DI) : DIAware {
init {
app.routing {
authenticate("jwt", "basic") {
withRole(Role.USER) {
withRole(Role.USER, Role.ADMIN) {
put<ApiRoot.AgentGroup, GroupUpdateDto>(
"Update group"
.examples(
Expand Down

0 comments on commit 4c09d54

Please sign in to comment.