-
Notifications
You must be signed in to change notification settings - Fork 13
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
[rewrite] Break up into service objects/resources #16
Comments
Adding more useful articles for reference |
Hey, I would like to take over this issue! If there are any other relevant resources and projects out there that meet your expectations from where you would like me to take inspiration from written specifically in GOLang, please link them here as well! I am a bit new to GOLang but I would like to learn further for this project. |
I also feel like the error handling here isn't done very well at the moment. For example, here, |
^Yes, that's the point of the rewrite. The current code (the methods inside the IntelOwlClient struct) are to be completely discarded. |
I am in the process of finishing this. Just a heads up! |
Kindly review my PR and let me know how I can make it better! |
Defining some basic primitives of what we are looking for.
c := IntelOwlClient(opts* IntelOwlClientOptions)
c.Job.List() -> []Job // will not take params because we will hard-code `?paginate=false` URL parameter.
c.Job.Get(id uint64) -> Job
c.Job.Delete(id uint64) -> bool
c.Job.DownloadSample(id uint64) -> []byte // or FileReader object?
c.Job.Kill(id uint64) -> bool
c.Job.Retry(id uint64) -> bool
c.Job.KillAnalyzer(id uint64, analyzerName string) -> bool
c.Job.KillConnector(id uint64, connectorName string) -> bool
c.Job.RetryAnalyzer(id uint64, analyzerName string) -> bool
c.Job.RetryConnector(id uint64, connectorName string) -> bool
c.Tag.List() -> []Tag // does not require URL params
c.Tag.Get(id uint64) -> Tag
c.Tag.Create(params* TagParams) -> Tag
c.Tag.Update(id uint64, params* TagParams) -> Tag
c.Tag.Delete(id uint64) -> bool
c.CreateFileAnalysis(params* FileAnalysisParams) -> AnalysisResponse
c.CreateObservableAnalysis(params* ObservableAnalysisParams) -> AnalysisResponse
c.Analyzer.GetConfigs() -> []AnalyzerConfig
c.Analyzer.HealthCheck(analyzerName string) -> bool
c.Connector.GetConfigs() -> []ConnectorConfig
c.Connector.HealthCheck(connectorName string) -> bool
// basic
type IntelOwlClientOptions struct {} // will contain url, token, certificate, etc.
// response
type Tag struct {
ID uint64 `json:"id"`
Label string `json:"label"`
Color string `json:"color"`
}
type Job struct {} // see JobSerializer on IntelOwl:dev-v4
type AnalysisResponse struct {} // see AnalysisResponseSerializer on IntelOwl:dev-v4
type AnalyzerConfig struct {}
type ConnectorConfig struct {}
// request
type TagParams struct {}
type FileAnalysisParams struct {} // see FileAnalysisSerializer on IntelOwl:dev-v4
type ObservableAnalysisParams struct {} // see ObservableAnalysisSerializer on IntelOwl:dev-v4 You can also refer to the pyintelowl.py for request parameters specification. |
API Endpoints TODO list:Tick when merged with master/main Tags
Analyzer
Connector
Job
Analysis
Me (User details)
Playbooks
|
Closing this as completed, #60 has been opened for playbook endpoints. |
I don't like approach of just appending functions to the
IntelOwlClient
struct.This SDK should be created following the approach given in this blog-post, especially the "Service Objects" heading.
This approach is very similar to how we (at Certego) wrote pydragonfly recently using the django-rest-client framework (also written by us).
The text was updated successfully, but these errors were encountered: