Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unused dependencies and classes #212

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

mcasas993
Copy link
Member

Description

Delete all classes related with the process of authentication in the server.

Delete all the not uses dependencies after the changes in the logic of command manager.

Issues Resolved

[203]

@mcasas993 mcasas993 requested a review from a team as a code owner January 10, 2025 18:41
@mcasas993 mcasas993 self-assigned this Jan 10, 2025
@mcasas993 mcasas993 linked an issue Jan 13, 2025 that may be closed by this pull request
7 tasks
@AlexRuiz7 AlexRuiz7 changed the title Delete Auth classes. Delete not used dependencies. Delete unused dependencies and classes Jan 13, 2025
@QU3B1M
Copy link
Member

QU3B1M commented Jan 13, 2025

Plugin can be built successfully

./gradlew build
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.10
  OS Info               : Mac OS X 15.2 (aarch64)
  JDK Version           : 21 (Amazon Corretto JDK)
  JAVA_HOME             : /Users/quebim_wz/Library/Java/JavaVirtualMachines/corretto-21.0.4/Contents/Home
  Random Testing Seed   : 6EDA6DA2AA89495B
  In FIPS 140 mode      : false
=======================================

> Task :javadoc
...

BUILD SUCCESSFUL in 13s
25 actionable tasks: 14 executed, 11 up-to-date

The command endpoint is working correctly

Request body
{
  "commands": [
    {
      "source": "Engine",
      "user": "user53",
      "target": {
        "id": "target4",
        "type": "agent"
      },
      "action": {
        "name": "restart",
        "args": {
          "arg1": "/path/to/executable/arg6"
        },
        "version": "v4"
      },
      "timeout": 30
    },
    {
      "source": "Engine",
      "user": "user53",
      "target": {
        "id": "target4",
        "type": "agent"
      },
      "action": {
        "name": "restart",
        "args": {
          "arg1": "/path/to/executable/arg6"
        },
        "version": "v4"
      },
      "timeout": 30
    },
    {
      "source": "Engine",
      "user": "user53",
      "target": {
        "id": "target4",
        "type": "agent"
      },
      "action": {
        "name": "restart",
        "args": {
          "arg1": "/path/to/executable/arg6"
        },
        "version": "v4"
      },
      "timeout": 30
    }
  ]
}

Response from the API

{
  "_index": ".commands",
  "_documents": [
    {
      "_id": "vFI2YJQBvsXcE-FflyT3"
    },
    {
      "_id": "vVI2YJQBvsXcE-FflyT3"
    },
    {
      "_id": "vlI2YJQBvsXcE-FflyT3"
    }
  ],
  "result": "OK"
}

The command is created

% curl http://127.0.0.1:9200/.commands/_search
{"took":4,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":3,"relation":"eq"},"max_score":1.0,"hits":[{"_index":".commands","_id":"vFI2YJQBvsXcE-FflyT3","_score":1.0,"_source":{"agent":{"groups":["groups000"]},"command":{"source":"Engine","user":"user53","target":{"type":"agent","id":"target4"},"action":{"name":"restart","args":{"arg1":"/path/to/executable/arg6"},"version":"v4"},"timeout":30,"status":"pending","order_id":"t1I2YJQBvsXcE-FflyT2","request_id":"tlI2YJQBvsXcE-FflyT2"},"@timestamp":"2025-01-13T15:09:38Z","delivery_timestamp":"2025-01-13T15:10:08Z"}},{"_index":".commands","_id":"vVI2YJQBvsXcE-FflyT3","_score":1.0,"_source":{"agent":{"groups":["groups000"]},"command":{"source":"Engine","user":"user53","target":{"type":"agent","id":"target4"},"action":{"name":"restart","args":{"arg1":"/path/to/executable/arg6"},"version":"v4"},"timeout":30,"status":"pending","order_id":"uVI2YJQBvsXcE-FflyT2","request_id":"uFI2YJQBvsXcE-FflyT2"},"@timestamp":"2025-01-13T15:09:38Z","delivery_timestamp":"2025-01-13T15:10:08Z"}},{"_index":".commands","_id":"vlI2YJQBvsXcE-FflyT3","_score":1.0,"_source":{"agent":{"groups":["groups000"]},"command":{"source":"Engine","user":"user53","target":{"type":"agent","id":"target4"},"action":{"name":"restart","args":{"arg1":"/path/to/executable/arg6"},"version":"v4"},"timeout":30,"status":"pending","order_id":"u1I2YJQBvsXcE-FflyT2","request_id":"ulI2YJQBvsXcE-FflyT2"},"@timestamp":"2025-01-13T15:09:38Z","delivery_timestamp":"2025-01-13T15:10:08Z"}}]}}

Copy link
Member

@QU3B1M QU3B1M left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlexRuiz7 AlexRuiz7 merged commit 6336b4c into master Jan 13, 2025
1 check passed
@AlexRuiz7 AlexRuiz7 deleted the 203-delete-unused-dependencies branch January 13, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt Command Manager to the new design
3 participants