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

Add OAuth 2.0 #40

Merged
merged 57 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9044bcb
Create codeql.yml
gwenblum Sep 30, 2024
0839034
Update codeql
gwenblum Sep 30, 2024
d750681
Merge branch 'riverbed:master' into master
gwenblum Oct 12, 2024
628350e
Add OAuth 2.0
gwenblum Oct 12, 2024
71177fb
Update codeql.yml
gwenblum Oct 12, 2024
e23568f
Refresh README change to md
gwenblum Oct 13, 2024
80b5301
Update README.md
gwenblum Oct 13, 2024
2c36088
Update README.md
gwenblum Oct 13, 2024
76a7eea
Update README.md
gwenblum Oct 13, 2024
63da49e
Fix CodeQL to remove L3C0:0: A parse error occurred while processing
gwenblum Oct 13, 2024
1462283
Update README.md
gwenblum Oct 13, 2024
fd68ca3
Fix config link in codeql.yml
gwenblum Oct 13, 2024
1549766
Action v3
gwenblum Oct 13, 2024
a14747a
Update path ignore
gwenblum Oct 13, 2024
c8d4c44
Without config
gwenblum Oct 13, 2024
db71d01
Use checkout v4
gwenblum Oct 13, 2024
a1a4ee8
Update config section
gwenblum Oct 13, 2024
6f8bb8b
Retry with configfile
gwenblum Oct 13, 2024
9b0b24f
Update
gwenblum Oct 13, 2024
c1abdac
Update
gwenblum Oct 13, 2024
33e6a8d
Update config
gwenblum Oct 13, 2024
062bae9
Update codeql config
gwenblum Oct 13, 2024
c6c079b
Try ignoring path from "on:" section
gwenblum Oct 13, 2024
1f5e19a
Retry codeql exclusion config
gwenblum Oct 13, 2024
f4b66d6
Update config
gwenblum Oct 13, 2024
7c6ef83
Revert
gwenblum Oct 13, 2024
4519ca1
CodeQL Done
gwenblum Oct 13, 2024
e8cca64
Merge branch 'master' into 2410-oauth2
gwenblum Oct 13, 2024
fb96497
Config
gwenblum Oct 13, 2024
c16b368
Same
gwenblum Oct 13, 2024
db589b7
Update codeql-config.yml
gwenblum Oct 13, 2024
8da241a
Update scrub passwords / Python 3
gwenblum Oct 13, 2024
13a0c71
Update README.md quickstart
gwenblum Oct 13, 2024
9b237be
Update README.md quickstart
gwenblum Oct 13, 2024
8c073ea
Update README.md quickstart
gwenblum Oct 13, 2024
b20609c
Update README.md quickstart
gwenblum Oct 13, 2024
f21b3f0
Update README.md
gwenblum Oct 13, 2024
f16eddc
Update README.md
gwenblum Oct 13, 2024
ae4704a
Update README.md
gwenblum Oct 13, 2024
8273519
Update README.md
gwenblum Oct 13, 2024
59e62b6
Update README.md
gwenblum Oct 13, 2024
40637d4
Update README.md
gwenblum Oct 13, 2024
ebbb5c8
Update README.md
gwenblum Oct 13, 2024
1c07780
Update README.md
gwenblum Oct 13, 2024
1789266
Update README.md
gwenblum Oct 13, 2024
283c02d
Update README.md
gwenblum Oct 13, 2024
ecfab18
Align codeql config
gwenblum Oct 13, 2024
1d1e7e3
Merge branch 'master' into 2410-oauth2
gwenblum Oct 13, 2024
28b8462
Update README.md
gwenblum Oct 13, 2024
44dbde6
Update README.md
gwenblum Oct 14, 2024
4aeace9
Update README.md
gwenblum Oct 14, 2024
07ec0a6
Update README.md
gwenblum Oct 14, 2024
2476b12
Update README.md
gwenblum Oct 14, 2024
fd5bcd2
Update README.md
gwenblum Oct 14, 2024
ff30df1
Update README.md
gwenblum Oct 14, 2024
c6b27b1
Update README.md
gwenblum Oct 14, 2024
f5ccf97
Update README.md
gwenblum Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
paths-ignore:
# Avoid CodeQL python scan error when processing the syntax test case: runner/work/steelscript/steelscript/tests/ss_fake/services/awesome_service/two/action.py#L3C0:0: A parse error occurred while processing
- '**/tests/ss_fake/services/awesome_service/two/action.py*'
paths-ignore:
# Avoid CodeQL python scan error when processing the syntax test case: runner/work/steelscript/steelscript/tests/ss_fake/services/awesome_service/two/action.py#L3C0:0: A parse error occurred while processing
- '**/tests/ss_fake/services/awesome_service/two/action.py*'
332 changes: 332 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,332 @@
# Riverbed SteelScript

Riverbed SteelScript is a collection of libraries and scripts written in Python for interacting with Riverbed solutions and appliances, and other network infrastructure devices.

## Quick Start

Here are 4 things you can do to start quick and easy with SteelScript.

<details>
<summary>Try examples just with git and Docker</summary>

### Quick Start SteelScript examples in a container

If you have [git](https://git-scm.com/downloads) and [Docker](https://www.docker.com/get-started) installed.
Open your shell (bash or PowerShell), build SteelScript from the latest source code and run it locally in a Docker container as follows:

#### Build and run SteelScript in a container

Build a docker image:

```shell
# Build a docker image from latest code
docker build --tag steelscript:latest https://github.com/riverbed/steelscript
```

Run SteelScript in a container:

```shell
# Run the image in an interactive container
docker run -it steelscript:latest /bin/bash
```

#### Try examples

You can try some script examples.


1. **AppResponse example**, print the Host Groups:

```shell
python examples/steelscript-appresponse/print_hostgroups-formatted.py {appresponse fqdn or IP address} -u {admin account} -p {password}
```

2. **Client Accelerator Controller example**, get the licenses and services:

```shell
python examples/steelscript-cacontroller/cacontroller-rest_api.py {client accelerator controller fqdn or IP address} --access_code {access_code}
```

3. **NetIM example**, list the devices:

```shell
python examples/steelscript-netim/print-netim-devices-raw.py {netim core fqdn or IP address} --username {account} --password {password}
```

</details>

<details>
<summary>Try SteelScript notebooks, just with git and Docker</summary>

### Quick Start SteelScript notebooks in a container

If you have [git](https://git-scm.com/downloads) and [Docker](https://www.docker.com/get-started) installed.
You can build a steelscript container image that includes the Jupyter server and allows to run notebooks.

Build both steelscript bash imags and notebook image:

```shell
# Build the steelscript base image
docker build --tag steelscript:latest https://github.com/riverbed/steelscript

# Build the steelscript image for Jupyter Notebook
docker build --tag steelscript.notebook -f Dockerfile.notebook https://github.com/riverbed/steelscript
```

Run a container with the steelscript.notebook image. It contains the Jupyter Notebook server and will be listening on port 8888 by default.

```shell
# Start the steelscript.notebook container with built-in Jupyter Notebook
docker run --init --rm -p 8888:8888 --name=steelscript.notebook steelscript.notebook
```

In the output, grab the url containing the *token*, for example *http://127.0.0.1:8888/tree?token=123456* , and open it in your browser to log into the Jupyter web-console.

From there, in the *Notebooks* folder you can find some notebook based on SteelScript:

* **AppResponse**: 01-appresponse-hostgroups.ipynb
* *work in progress* NetProfiler

</details>

<details>
<summary>Try SteelScript notebooks in your own SteelScript environment, just with python, pip, git and vscode</summary>

### Quick Start SteelScript notebooks in your environment

If you have all the tools ready:
1. [Python](https://www.python.org/downloads) and pip
2. [git](https://git-scm.com/downloads)
3. [Visual Studio Code](https://code.visualstudio.com)

Download a notebook for SteelScript, open it in Visual Studio Code and your good to go:

* *work in progress* [Steelscript](https://github.com/riverbed/Riverbed-Community-Toolkit/SteelScript) in the [Riverbed Community Toolkit](https://github.com/riverbed/Riverbed-Community-Toolkit)
* **AppResponse**: [Hostgroups](https://github.com/riverbed/steelscript-appresponse/blob/master/notebooks/01-appresponse-hostgroups.ipynb)

> Jupyter Notebook files have .ipynb extension, [more about Jupyter Notebook](https://jupyter.org)

</details>

<details>
<summary>Just install SteelScript modules in your Python environment, with pip and git</summary>

### Quick Start SteelScript in your environment

If you have all the tools installed in your environment: [Python](https://www.python.org/downloads), pip, and [git](https://git-scm.com/downloads)

Then, open your shell (bash or PowerShell) to install SteelScript and modules (directly from the latest source code):

```shell
# Install SteelScript and modules
pip install git+https://github.com/riverbed/steelscript
pip install git+https://github.com/riverbed/steelscript-appresponse
pip install git+https://github.com/riverbed/steelscript-netim
pip install git+https://github.com/riverbed/steelscript-netprofiler
pip install git+https://github.com/riverbed/steelscript-steelhead
pip install git+https://github.com/riverbed/steelscript-scc
# ... and others check the list on https://github.com/orgs/riverbed/repositories?q=steelscript
```

> Find all the steelscript modules: [steelscript repositories](https://github.com/orgs/riverbed/repositories?q=steelscript)

</details>

## Get SteelScript

SteelScript and modules are distributed via [Riverbed in GitHub](https://github.com/riverbed). The main repository is [SteelScript](https://github.com/riverbed/steelscript).

To use SteelScript, it is recommended to either build your own SteelScript container or install the SteelScript modules in your own Python environment directly from the source in GitHub main repository. Refer to the quickstarts in the section above - *the guide needs update*.

> [!NOTE]
> Other distributions have not been maintained and contain outdated versions of SteelScript: [*outdated* SteelScript on Dockerhub](https://hub.docker.com/r/riverbed/steelscript), [*outdated* SteelScript in pypi](https://pypi.org/search/?q=steelscript), ...

## Guide

> [!NOTE]
> The [SteelScript guide](https://support.riverbed.com/apis/steelscript) needs a good refresh. The source is there [https://github.com/riverbed/steelscript/docs](https://github.com/riverbed/steelscript/docs)

## About SteelScript

### The Framework

The common module for SteelScript is in the [SteelScript repository](https://github.com/riverbed/steelscript). It contains common code but also it is the entrypoint for Documentation, Build, Test and releases.

Other SteelScript modules have their own repository. The repository name is prefixed by "steelscript": [List of SteelScript repositories](https://github.com/orgs/riverbed/repositories?q=steelscript)

#### Modules for Riverbed products and appliances:

- [AppResponse](https://github.com/riverbed/steelscript-appresponse)
- [NetIM](https://github.com/riverbed/steelscript-netim)
- [NetProfiler](https://github.com/riverbed/steelscript-netprofiler)
- [SteelHead](https://github.com/riverbed/steelscript-steelhead)
- [SteelHead Controller](https://github.com/riverbed/steelscript-scc), also called SCC
- [Client Accelerator Controller (CAC)](https://github.com/riverbed/steelscript-client-accelerator-controller), formerly called SteelHead Mobile controller, SMC or SCCM

#### Extra modules

- [Wireshark](https://github.com/riverbed/steelscript-wireshark)
- [NetShark](https://github.com/riverbed/steelscript-netshark)
- [Packets](https://github.com/riverbed/steelscript-packets)
- [Command line Access](https://github.com/riverbed/steelscript-cmdline)

#### Other repos for components and SteelScript extensions:

> [!NOTE]
> The following have known issues and maintenance is pending

- *pending mantenance* [Application Framework](https://github.com/riverbed/steelscript-appfwk)
- *pending mantenance* [Business hour reporting plugin for Application Framework](https://github.com/riverbed/steelscript-appfwk-business-hours)
- *pending mantenance* [Stock report demo with Application Framework](https://github.com/riverbed/steelscript-appfwk-business-hours)
- *pending mantenance* [VM Config](https://github.com/riverbed/steelscript-vm-config)

<details>
<summary>More about SteelScript</summary>

### Folder Structure for Modules

SteelScript is based on Python 3.
The repos of SteelScript modules have a common structure

```
steelscript-module-name # for example: steelscript-appresponse
├── README.md or README.rst # Markdown is preferred (.md) and reStructuredText (.rst)
├── LICENSE
├── CHANGELOG
├── .gitignore
├── docs
├── steelscript
│ ├── __init__.py
│ └── module-name # for example: appresponse
│ ├── core
│ │ └── __init__.py
│ ├── commands
│ │ └── __init__.py
│ └── __init__.py
├── tests
├── setup.py
├── notebooks
└── tox.ini
```

Mandatory:

- README.md (or README.rst): README in Markdown (.md) or reStructuredText (.rst) format. Markdown is preferred.
- LICENSE: Riverbed Technology copyright, terms and conditions based on MIT
- CHANGELOG: Simple text file tracking major changes
- /docs: Documentation using reStructured Text (rst) file format.
- /: Python scripts samples showing how to use the module.
- /steelscript: The actual code, written in Python. Must be Python3 only.
- /tests: Test plans and unit test. Can be organized in subfolders. Test plan are ideally documented and easy to run scripts but can be anything defining a test plan (script, text, ...), for example a python script based on pytest.
- setup.py: Python setup file containing meta descriptions and requirements. Based on setuptools, distutils and pytest. Should NOT contain unit test (use Tox and put unit test inside /tests folder instead)


Optional:

- /tox.ini: standardized python testing definition based on [Tox](https://tox.readthedocs.io/en/latest)
- /notebooks: Notebooks based on [Jupyter](https://jupyter.org)

> Contributions for alternative distribution methods and packaging (like pypi, rpm, .deb, rpm, tgz, ...) can be organized inside the `/packaging` folder in the main [SteelScript repository](https://github.com/riverbed/steelscript)

### Build

Builds are defined in the [SteelScript repository](https://github.com/riverbed/steelscript)

#### Prebuild test-plans validations

Execute test-plans with tox

```shell
pip install tox
tox
```

#### Building Docker containers

Some Dockerfile are provided to build different flavors of the SteelScript container image:

- Dockerfile: standard build
- Dockerfile.slim: optimized build
- Dockerfile.notebook: build for demo and learning with Notebooks
- Dockerfile.dev: build development and testing container from master or fork/branch


<details>
<summary>Build snippets</summary>

##### Standard:

```shell
docker build --tag steelscript -f Dockerfile .
```

##### Slim:

```shell
docker build --tag steelscript.slim -f Dockerfile.slim .
```

##### Notebook

```shell
docker build --tag steelscript.notebook -f Dockerfile.notebook .
```

</details>

<details>
<summary>Dev snippets</summary>

##### Dev from master

```shell
git clone https://github.com/riverbed/steelscript --depth 1 --recurse-submodules
git clone https://github.com/riverbed/steelscript-netprofiler --depth 1 --recurse-submodules
git clone https://github.com/riverbed/steelscript-wireshark --depth 1 --recurse-submodules
git clone https://github.com/riverbed/steelscript-cmdline --depth 1 --recurse-submodules
git clone https://github.com/riverbed/steelscript-scc --depth 1 --recurse-submodules
git clone https://github.com/riverbed/steelscript-appresponse --depth 1 --recurse-submodules
git clone https://github.com/riverbed/steelscript-netim --depth 1 --recurse-submodules
git clone https://github.com/riverbed/steelscript-client-accelerator-controller --depth 1 --recurse-submodules
git clone https://github.com/riverbed/steelscript-steelhead --depth 1 --recurse-submodules
git clone https://github.com/riverbed/steelscript-packets.git --depth 1 --recurse-submodules

docker build --tag steelscript.dev --progress=plain -f steelscript/Dockerfile.dev .
```

##### Dev from your_fork/your_branch

```shell
git clone https://github.com/your_fork/steelscript --depth 1 --recurse-submodules -b your_branch
git clone https://github.com/your_fork/steelscript-netprofiler --depth 1 --recurse-submodules -b your_branch
git clone https://github.com/your_fork/steelscript-wireshark --depth 1 --recurse-submodules -b your_branch
git clone https://github.com/your_fork/steelscript-cmdline --depth 1 --recurse-submodules -b your_branch
git clone https://github.com/your_fork/steelscript-scc --depth 1 --recurse-submodules -b your_branch
git clone https://github.com/your_fork/steelscript-appresponse --depth 1 --recurse-submodules -b your_branch
git clone https://github.com/your_fork/steelscript-netim --depth 1 --recurse-submodules -b your_branch
git clone https://github.com/your_fork/steelscript-client-accelerator-controller --depth 1 --recurse-submodules -b your_branch
git clone https://github.com/your_fork/steelscript-steelhead --depth 1 --recurse-submodules -b your_branch
git clone https://github.com/your_fork/steelscript-packets.git --depth 1 --recurse-submodules -b your_branch

docker build --tag steelscript.dev --progress=plain -f steelscript/Dockerfile.dev .
```

</details>

</details>

## Contribute

Feel free to use, enhance and contribute by creating issues, sending pull requests (PR), extending with new modules ...

## License

Copyright (c) 2021-2024 Riverbed Technology, Inc.

SteelScript is licensed under the terms and conditions of the MIT License
accompanying the software ("License"). SteelScript is distributed "AS
IS" as set forth in the License. SteelScript also includes certain third
party code. All such third party code is also distributed "AS IS" and is
licensed by the respective copyright holders under the applicable terms and
conditions (including, without limitation, warranty and liability disclaimers)
identified in the license notices accompanying the software.
Loading