Skip to content

Commit 03d7cf7

Browse files
authored
add contributing.md and security.md (#178)
1 parent 8eb5ca5 commit 03d7cf7

3 files changed

Lines changed: 50 additions & 109 deletions

File tree

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# How to contribute to this repo
2+
3+
We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
4+
5+
- Reporting a bug
6+
- Proposing new features
7+
- Discussing the current state of the code
8+
- Submitting a fix
9+
10+
This is how you should do it:
11+
12+
Use our [issue list](../../issues) to report a **bug** or **propose a new feature**, including
13+
14+
### Reporting a **bug report**
15+
- A quick summary and/or background
16+
- Steps to reproduce
17+
- What actually happens
18+
19+
### Adding a **feature request**
20+
- Brief description of the feature
21+
- What problem/issue will this solve
22+
- A sort of Definition of Done - "How should it look when finished"
23+
24+
### When submitting a fix using a Pull Request (PR)
25+
- Fork this repository from GitHub
26+
- After you have made the changes, create a pull request (PR)
27+
28+
We will review the pull request and if it is appropriate and there are no clashes or vulnerabilities, it will be merged to the main code.

README.md

Lines changed: 4 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Python wrappers for Sumo APIs
44

5+
Want to contribute? Read our [contributing](./CONTRIBUTING.md) guidelines
6+
57
## Install:
68

79
pip install sumo-wrapper-python
@@ -22,20 +24,10 @@ distribution.
2224
- [`token` logic](#token-logic)
2325
- [Methods](#methods)
2426
- [get(path, \*\*params)](#getpath-params)
25-
- [post(path, json, blob)](#postpath-json-blob)
27+
- [post(path, json, blob, params)](#postpath-json-blob-params)
2628
- [put(path, json, blob)](#putpath-json-blob)
2729
- [delete(path)](#deletepath)
2830
- [Async methods](#async-methods)
29-
- [CallSumoApi (deprecated)](#callsumoapi-deprecated)
30-
- [Initialization](#initialization-1)
31-
- [Parameters](#parameters-1)
32-
- [Examples](#examples)
33-
- [search()](#search)
34-
- [Parameters](#parameters-2)
35-
- [Usage](#usage)
36-
- [searchroot()](#searchroot)
37-
- [Parameters](#parameters-3)
38-
- [Usage](#usage-1)
3931

4032
# SumoClient
4133

@@ -115,7 +107,7 @@ object_id = "159405ba-0046-b321-55ce-542f383ba5c7"
115107
obj = sumo.get(f"/objects('{object_id}')")
116108
```
117109

118-
### post(path, json, blob)
110+
### post(path, json, blob, params)
119111

120112
Performs a POST-request to sumo-core. Accepts json and blob, but not both at the
121113
same time.
@@ -166,100 +158,3 @@ These accept the same parameters as their synchronous counterparts, but have to
166158
# Retrieve userdata
167159
user_data = await sumo.get_async("/userdata")
168160
```
169-
170-
# CallSumoApi (deprecated)
171-
172-
Predefined methods for various sumo operations. I.e uploading, searching for and
173-
deleting metadata and blobs.
174-
175-
### Initialization
176-
177-
```python
178-
from sumo.wrapper import CallSumoApi
179-
180-
sumo = CallSumoApi()
181-
```
182-
183-
### Parameters
184-
185-
```python
186-
class CallSumoApi:
187-
def __init__(
188-
self,
189-
env="dev",
190-
resource_id=None,
191-
client_id=None,
192-
outside_token=False,
193-
writeback=False,
194-
):
195-
```
196-
197-
## Examples
198-
199-
All `CallSumoApi` methods accept a `bearer` argument which lets the user use an
200-
existing access token instead of generating a new one.
201-
202-
### search()
203-
204-
Search all objects in sumo.
205-
206-
#### Parameters
207-
208-
```python
209-
def search(
210-
self,
211-
query,
212-
select=None,
213-
buckets=None,
214-
search_from=0,
215-
search_size="100",
216-
search_after=None,
217-
bearer=None,
218-
):
219-
```
220-
221-
#### Usage
222-
223-
```python
224-
# Find objects where class = surface
225-
search_results = sumo.search(query="class:surface", search_size="10")
226-
227-
# Get child objects for a specific object
228-
parent_id = "1234"
229-
children = sumo.search(query=f"_sumo.parent_object:{parent_id}")
230-
231-
# Get buckets for child object classes (i.e surface, table, polygon)
232-
# This will return a count for every class value
233-
buckets = sumo.search(
234-
query=f"_sumo.parent_object:{parent_id}",
235-
buckets=["class.keyword"]
236-
)
237-
```
238-
239-
### searchroot()
240-
241-
Search for parent objects (object without parent)
242-
243-
#### Parameters
244-
245-
```python
246-
def searchroot(
247-
self,
248-
query,
249-
select=None,
250-
buckets=None,
251-
search_from=0,
252-
search_size="100",
253-
bearer=None,
254-
):
255-
```
256-
257-
#### Usage
258-
259-
```python
260-
# Get 3 top level objects for a specific user
261-
peesv_objects = sumo.searchroot(
262-
query="fmu.case.user.id:peesv",
263-
search_size=3
264-
)
265-
```

SECURITY.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Security
2+
3+
If you discover a security vulnerability in this project, please follow these steps to responsibly disclose it:
4+
5+
1. **Do not** create a public GitHub issue for the vulnerability.
6+
2. Follow our guideline for Responsible Disclosure Policy at [https://www.equinor.com/about-us/csirt](https://www.equinor.com/about-us/csirt) to report the issue
7+
8+
The following information will help us triage your report more quickly:
9+
10+
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
11+
- Full paths of source file(s) related to the manifestation of the issue
12+
- The location of the affected source code (tag/branch/commit or direct URL)
13+
- Any special configuration required to reproduce the issue
14+
- Step-by-step instructions to reproduce the issue
15+
- Proof-of-concept or exploit code (if possible)
16+
- Impact of the issue, including how an attacker might exploit the issue
17+
18+
We prefer all communications to be in English.

0 commit comments

Comments
 (0)