Skip to content

Commit

Permalink
Update various names for consistency/clarity (#90)
Browse files Browse the repository at this point in the history
* Update various names for consistency/clarity

* updates all of the docs to mention resources and clean up the api/cli pages

* updates all of the object references to be resource references in the fidesctl source code

* removes some underscores that aren't needed

Co-authored-by: Thomas La Piana <[email protected]>
  • Loading branch information
ThomasLaPiana and Thomas La Piana authored Sep 8, 2021
1 parent a1c2bee commit 01f4e21
Show file tree
Hide file tree
Showing 30 changed files with 270 additions and 354 deletions.
96 changes: 0 additions & 96 deletions docs/fides/docs/api.md

This file was deleted.

13 changes: 13 additions & 0 deletions docs/fides/docs/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Fidesctl

Fidesctl wraps the functionality of the Fides Server into a CLI tool to be used by either engineers or within CI/CD pipelines.

## Commands

* `fidesctl apply <manifest_dir> [--dry] [--diff]` - Creates or Updates resources found within the YAML file(s) at the specified path.
* `fidesctl evaluate [-k,--fides-key] [-m, --message] [--dry]` - Runs an evaluation of all policies, but a single policy can be specified using the `--fides-key` parameter.
* `fidesctl find <resource_type> <fides_key>` - Looks up a specific resource on the server by its type and `fides_key`.
* `fidesctl ls <resource_type>` - Shows a list of resources of a certain type that exist on the server.
* `fidesctl ping` - Pings the server to make sure that a connection can be established.
* `fidesctl version` - Shows the version of Fides that is installed.
* `fidesctl view-config`- Show a JSON representation of the config that Fides is using.
2 changes: 1 addition & 1 deletion docs/fides/docs/development/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ When making changes to the codebase, make sure to follow the [Pull Request Guide
1. sbt ~jetty:start
1. Endpoints should now be available @ `http://localhost:8080`
1. Current mapping of endpoints can be seen @ src/main/scala/ScalatraBootstrap
1. Current structure of domain objects can be seen with `sbt test:runMain devtools.Generators`
1. Current structure of domain resources can be seen with `sbt test:runMain devtools.Generators`

### Scala Tasks

Expand Down
2 changes: 1 addition & 1 deletion docs/fides/docs/development/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To write concept docs, add Markdown files to the `docs/fides/docs/` directory (o

Concepts that refer to proper nouns or are trademarked should always be capitalized, including "Fides" and "FidesAPI".

Other Fides terms, like "Data Category" or "System", should also be capitalized to be clear about the fact that a Fides object is being referenced.
Other Fides terms, like "Data Category" or "System", should also be capitalized to be clear about the fact that a Fides resource is being referenced.

> When a System is applied, it is either created or updated through the FidesAPI.
>
Expand Down
2 changes: 1 addition & 1 deletion docs/fides/docs/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Fides's tests are stored in the `tests` directory.
Tests should have descriptive names that make it clear what you're testing. If necessary, add a docstring or comment to explain why you're testing this specific thing.

```python
def test_dry_evaluate_system_fail(server_url, objects_dict):
def test_dry_evaluate_system_fail(server_url, resources_dict):
...

# bad test name
Expand Down
16 changes: 8 additions & 8 deletions docs/fides/docs/fides_resources.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Fides Object Types
# Fides Resource Types

This page describes the various objects that make up the Fides platform.
This page describes the various resources that make up the Fides platform.

## Object Relationship Diagram
## Resource Relationship Diagram

![alt text](img/Object_Relations.svg "Fides Manifest Workflow")
![alt text](img/Resource_Relations.svg "Fides Manifest Workflow")

## Organization

An organization is a logical grouping of objects, and all objects must belong to an organization. Fides includes a default organization with an id of 1.
An organization is a logical grouping of resources, and all resources must belong to an organization. Fides includes a default organization with an id of 1.

=== "Example Manifest"

Expand Down Expand Up @@ -225,7 +225,7 @@ A system represents the privacy usage of a single software project, service, cod

### Privacy Declaration

A Privacy Declaration describes the usage of data within a system. It is included as a composite object within a system declaration.
A Privacy Declaration describes the usage of data within a system. It is included as a composite resource within a system declaration.

| Name | Type | Description |
| --- | --- | --- |
Expand All @@ -241,7 +241,7 @@ A Privacy Declaration can be read as "This system uses data in categories `dataC

## Dataset

A Dataset represents any kind of place where data is stored and includes a sub-object that describes the fields within that dataset.
A Dataset represents any kind of place where data is stored and includes a sub-resource that describes the fields within that dataset.

=== "Example Manifest"

Expand Down Expand Up @@ -293,7 +293,7 @@ A Field describes a single column or array of data within a dataset. Data descri

## Policies

Policies group together sets of privacy rules into a single object. These are the objects that systems and registries will be evaluated against.
Policies group together sets of privacy rules into a single resource. These are the resources that systems and registries will be evaluated against.

=== "Example Manifest"

Expand Down
12 changes: 0 additions & 12 deletions docs/fides/docs/fidesctl.md

This file was deleted.

File renamed without changes
2 changes: 1 addition & 1 deletion docs/fides/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If you'd like a quick Roman mythology lesson, check out [Fides on Wikipedia](htt

## Core Components

Conceptually, there are a few key parts to Fides privacy management. For more in-depth info on each object and their respective schemas, see the [Fides Resources](fides_resources.md) page.
Conceptually, there are a few key parts to Fides privacy management. For more in-depth info on each resource and their respective schemas, see the [Fides Resources](fides_resources.md) page.

### Systems

Expand Down
6 changes: 3 additions & 3 deletions docs/fides/docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Use either the [Docker](getting_started/docker.md) (**recommended**) or [Local](

## Writing Manifest Files

The next step is to write the manifest files that describe your privacy data usage with the Fides privacy ontology. Manifest files are written in YAML and are used to create and update objects via the FidesAPI.
The next step is to write the manifest files that describe your privacy data usage with the Fides privacy ontology. Manifest files are written in YAML and are used to create and update resources via the FidesAPI.

First create a directory for the manifests to live in:

`mkdir fides_manifests/`

Next, you'll need to write a System manifest file and a Policy manifest file. These are the only two required objects for Fides to function. For an exhaustive set of example manifests see the [Fides Resources](fides_resources.md) page. Included below are the examples we'll assume are being used for the sake of the tutorial.
Next, you'll need to write a System manifest file and a Policy manifest file. These are the only two required resources for Fides to function. For an exhaustive set of example manifests see the [Fides Resources](fides_resources.md) page. Included below are the examples we'll assume are being used for the sake of the tutorial.

=== "fides_manifests/policy.yml"

Expand Down Expand Up @@ -127,7 +127,7 @@ Next, you'll need to write a System manifest file and a Policy manifest file. Th

## Applying Manifest Files

Once you've finished writing your manifest files, it's time to apply them to the server. This is done with a single `fidesctl` command that handles both creating _and_ updating objects. If an object with the same type and fidesKey already exists, that object will be updated if a change has been made.
Once you've finished writing your manifest files, it's time to apply them to the server. This is done with a single `fidesctl` command that handles both creating _and_ updating resources. If a resource with the same type and fidesKey already exists, that resource will be updated if a change has been made.

If we assume the same directory name as before for where our manifests are located, the command would be:

Expand Down
3 changes: 1 addition & 2 deletions docs/fides/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ nav:
- getting_started/local.md
- Tutorial: tutorial.md
- Deployment: deployment.md
- Fidesctl: fidesctl.md
- FidesAPI: api.md
- CLI: cli.md
- Development:
- Overview: development/overview.md
- Contributing: development/contributing.md
Expand Down
40 changes: 20 additions & 20 deletions fidesctl/src/fidesctl/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
fides_key_argument,
id_argument,
manifests_dir_argument,
object_type_argument,
resource_type_argument,
)
from fidesctl.cli.utils import (
handle_cli_response,
Expand Down Expand Up @@ -35,73 +35,73 @@ def view_config(ctx: click.Context) -> None:
########################
@click.command()
@click.pass_context
@object_type_argument
@resource_type_argument
@fides_key_argument
def find(ctx: click.Context, object_type: str, fides_key: str) -> None:
def find(ctx: click.Context, resource_type: str, fides_key: str) -> None:
"""
Get an object by its fidesKey.
Get an resource by its fidesKey.
"""
config = ctx.obj["CONFIG"]
handle_cli_response(
_api.find(
url=config.cli.server_url,
object_type=object_type,
object_key=fides_key,
resource_type=resource_type,
resource_key=fides_key,
headers=config.user.request_headers,
)
)


@click.command()
@click.pass_context
@object_type_argument
@resource_type_argument
@id_argument
def delete(ctx: click.Context, object_type: str, object_id: str) -> None:
def delete(ctx: click.Context, resource_type: str, resource_id: str) -> None:
"""
Delete an object by its id.
Delete an resource by its id.
"""
config = ctx.obj["CONFIG"]
handle_cli_response(
_api.delete(
url=config.cli.server_url,
object_type=object_type,
object_id=object_id,
resource_type=resource_type,
resource_id=resource_id,
headers=config.user.request_headers,
)
)


@click.command(hidden=True)
@click.pass_context
@object_type_argument
@resource_type_argument
@id_argument
def get(ctx: click.Context, object_type: str, object_id: str) -> None:
def get(ctx: click.Context, resource_type: str, resource_id: str) -> None:
"""
Get an object by its id.
Get an resource by its id.
"""
config = ctx.obj["CONFIG"]
handle_cli_response(
_api.get(
url=config.cli.server_url,
object_type=object_type,
object_id=object_id,
resource_type=resource_type,
resource_id=resource_id,
headers=config.user.request_headers,
)
)


@click.command()
@click.pass_context
@object_type_argument
def ls(ctx: click.Context, object_type: str) -> None: # pylint: disable=invalid-name
@resource_type_argument
def ls(ctx: click.Context, resource_type: str) -> None: # pylint: disable=invalid-name
"""
List all objects of a certain type.
List all resources of a certain type.
"""
config = ctx.obj["CONFIG"]
handle_cli_response(
_api.ls(
url=config.cli.server_url,
object_type=object_type,
resource_type=resource_type,
headers=config.user.request_headers,
)
)
Expand Down
8 changes: 4 additions & 4 deletions fidesctl/src/fidesctl/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
from fideslang import model_list


def object_type_argument(command: Callable) -> Callable:
"Add the object_type option."
def resource_type_argument(command: Callable) -> Callable:
"Add the resource_type option."
command = click.argument(
"object_type", type=click.Choice(model_list, case_sensitive=False)
"resource_type", type=click.Choice(model_list, case_sensitive=False)
)(command)
return command


def id_argument(command: Callable) -> Callable:
"Add the id argument."
command = click.argument(
"object_id",
"resource_id",
type=str,
)(command)
return command
Expand Down
Loading

0 comments on commit 01f4e21

Please sign in to comment.