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

Allow from_or_to_id to get relationship #739

Closed
wants to merge 1 commit into from

Conversation

DucNg
Copy link

@DucNg DucNg commented Sep 26, 2024

Proposed changes

  • Allow read relationship using from_or_to_id

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

I guess it's a programming oversight not to allow read using from_or_to_id since it works just by adding this condition.
I'm open to adding a test case for this change but I wasn't able to find a proper example with fixtures.

How to test

  • Get the id of an element with a relationship from your OpenCTI
import pycti

OPENCTI_URL = "http://localhost:8080"
OPENCTI_TOKEN = "<token>"
opencti_client = pycti.OpenCTIApiClient(OPENCTI_URL, OPENCTI_TOKEN)
toto = opencti_client.stix_core_relationship.read(
    fromOrToId="<id of an element with a relationship>"
)
print(toto)

@DucNg
Copy link
Author

DucNg commented Sep 30, 2024

@DucNg DucNg closed this Sep 30, 2024
@DucNg DucNg deleted the relationship-fromorto branch September 30, 2024 13:34
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.

1 participant