Skip to content

Commit

Permalink
Text edits (#68)
Browse files Browse the repository at this point in the history
* change secret names

* edits

* lower

* fix tests
  • Loading branch information
nikitastupin authored Mar 18, 2023
1 parent de71a0f commit e639999
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4

- name: Install dependencies
run: |
pip install poetry
run: pip install poetry

- name: Setup poetry
run: |
poetry config virtualenvs.in-project true
poetry install --no-dev
- name: Build package
run: |
source .venv/bin/activate
poetry build
- name: Upload package
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -41,8 +45,8 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -57,7 +61,7 @@ jobs:
context: ./
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/clairvoyance:latest
tags: ${{ secrets.DOCKERHUB_USERNAME }}/clairvoyance:latest
platforms: linux/amd64,linux/arm64

- name: Image digest
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Clairvoyance

Obtain GraphQL API Schema even if the introspection is disabled.
Obtain GraphQL API schema even if the introspection is disabled.

[![PyPI](https://img.shields.io/pypi/v/clairvoyance)](https://pypi.org/project/clairvoyance/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/clairvoyance)](https://pypi.org/project/clairvoyance/)
Expand All @@ -11,14 +11,14 @@ Obtain GraphQL API Schema even if the introspection is disabled.

Some GraphQL APIs have disabled introspection. For example, [Apollo Server disables introspection automatically if the `NODE_ENV` environment variable is set to `production`](https://www.apollographql.com/docs/tutorial/schema/#explore-your-schema).

Clairvoyance allows us to get GraphQL API schema when introspection is disabled. It produces schema in JSON format suitable for other tools like [GraphQL Voyager](https://github.com/APIs-guru/graphql-voyager), [InQL](https://github.com/doyensec/inql) or [graphql-path-enum](https://gitlab.com/dee-see/graphql-path-enum).
Clairvoyance helps to obtain GraphQL API schema even if the introspection is disabled. It produces schema in JSON format suitable for other tools like [GraphQL Voyager](https://github.com/APIs-guru/graphql-voyager), [InQL](https://github.com/doyensec/inql) or [graphql-path-enum](https://gitlab.com/dee-see/graphql-path-enum).

## Contributors

Thanks to the [contributors](#contributors) for their work.
Thanks to the contributors for their work.

- [nikitastupin](https://github.com/nikitastupin)
- [Escape](https://escape.tech) team :
- [Escape](https://escape.tech) team
- [iCarossio](https://github.com/iCarossio)
- [Swan](https://github.com/c3b5aw)
- [QuentinN42](https://github.com/QuentinN42)
Expand All @@ -28,15 +28,17 @@ Thanks to the [contributors](#contributors) for their work.
- [noraj](https://github.com/noraj)
- [belane](https://github.com/belane)

## Getting started
## Getting Started

### pip

```bash
pip install clairvoyance
clairvoyance https://rickandmortyapi.com/graphql -o schema.json
# should take about 2 minute
# should take about 2 minutes
```

## Docker Image
### docker

```bash
docker run --rm nikitastupin/clairvoyance --help
Expand All @@ -51,7 +53,7 @@ There are at least two approaches:
- Use general English words (e.g. [google-10000-english](https://github.com/first20hours/google-10000-english)).
- Create target specific wordlist by extracting all valid GraphQL names from application HTTP traffic, from mobile application static files, etc. Regex for GraphQL name is [`[_A-Za-z][_0-9A-Za-z]*`](http://spec.graphql.org/June2018/#sec-Names).

### Environment Variables
### Environment variables

```bash
LOG_FMT=`%(asctime)s \t%(levelname)s\t| %(message)s` # A string format for logging.
Expand All @@ -71,4 +73,4 @@ Pull requests are welcome! For major changes, please open an issue first to disc

## Documentation

- You may find more details on how the tool works in the second half of the [GraphQL APIs from bug hunter's perspective by Nikita Stupin](https://youtu.be/nPB8o0cSnvM) talk.
You may find more details on how the tool works in the second half of the [GraphQL APIs from bug hunter's perspective by Nikita Stupin](https://youtu.be/nPB8o0cSnvM) talk.
2 changes: 1 addition & 1 deletion clairvoyance/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def cli(argv: Optional[List[str]] = None) -> None:
if args.validate:
wordlist_parsed = [w for w in wordlist if re.match(r'[_A-Za-z][_0-9A-Za-z]*', w)]
logging.info(
f'Removed {len(wordlist) - len(wordlist_parsed)} items from Wordlist, to conform to name regex. '
f'Removed {len(wordlist) - len(wordlist_parsed)} items from wordlist, to conform to name regex. '
f'https://spec.graphql.org/June2018/#sec-Names'
)
wordlist = wordlist_parsed
Expand Down
2 changes: 1 addition & 1 deletion tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_type(self, name: str) -> Optional[Dict[str, Any]]:
return None

def test_validate_wordlist(self):
self.assertIn(b'Removed 1 items from Wordlist', self.clairvoyance.stderr)
self.assertIn(b'Removed 1 items from wordlist', self.clairvoyance.stderr)

def test_found_root_type_names(self) -> None:
self.assertEqual(self.schema['queryType'], {'name': 'Query'})
Expand Down

0 comments on commit e639999

Please sign in to comment.