Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Sep 25, 2020
1 parent 1f68f19 commit 7a1ac3d
Show file tree
Hide file tree
Showing 15 changed files with 1,436 additions and 1,355 deletions.
3 changes: 2 additions & 1 deletion cmd/identities/definitions_test.go
Expand Up @@ -4,10 +4,11 @@ import (
"bytes"
"context"
"errors"
"github.com/ory/kratos/identity"
"io"
"testing"

"github.com/ory/kratos/identity"

"github.com/spf13/cobra"
"github.com/stretchr/testify/require"

Expand Down
3 changes: 2 additions & 1 deletion cmd/identities/get_test.go
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"encoding/json"
"errors"
"testing"

"github.com/ory/kratos/internal/clihelpers"
"github.com/ory/kratos/x"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
16 changes: 9 additions & 7 deletions cmd/identities/import_test.go
Expand Up @@ -5,16 +5,18 @@ import (
"context"
"encoding/json"
"errors"
"io/ioutil"
"testing"

"github.com/gofrs/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"

"github.com/ory/kratos/driver/configuration"
"github.com/ory/kratos/internal/clihelpers"
"github.com/ory/kratos/internal/httpclient/models"
"github.com/ory/x/pointerx"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"io/ioutil"
"testing"
)

func TestImportCmd(t *testing.T) {
Expand All @@ -23,7 +25,7 @@ func TestImportCmd(t *testing.T) {
t.Run("case=imports a new identity from file", func(t *testing.T) {
i := models.CreateIdentity{
SchemaID: pointerx.String(configuration.DefaultIdentityTraitsSchemaID),
Traits: map[string]interface{}{},
Traits: map[string]interface{}{},
}
ij, err := json.Marshal(i)
require.NoError(t, err)
Expand All @@ -44,7 +46,7 @@ func TestImportCmd(t *testing.T) {
t.Run("case=imports a new identity from stdIn", func(t *testing.T) {
i := models.CreateIdentity{
SchemaID: pointerx.String(configuration.DefaultIdentityTraitsSchemaID),
Traits: map[string]interface{}{},
Traits: map[string]interface{}{},
}
ij, err := json.Marshal(i)
require.NoError(t, err)
Expand Down
10 changes: 6 additions & 4 deletions cmd/identities/list_test.go
Expand Up @@ -2,12 +2,14 @@ package identities

import (
"context"
"github.com/ory/kratos/identity"
"github.com/ory/kratos/internal/clihelpers"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"strings"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/ory/kratos/identity"
"github.com/ory/kratos/internal/clihelpers"
)

func TestListCmd(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions cmd/identities/validate.go
Expand Up @@ -5,12 +5,14 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"

"github.com/markbates/pkger"
"github.com/ory/kratos/internal/clihelpers"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/tidwall/gjson"
"io/ioutil"

"github.com/ory/kratos/internal/clihelpers"

"github.com/ory/jsonschema/v3"
"github.com/ory/kratos/cmd/cliclient"
Expand Down
28 changes: 15 additions & 13 deletions cmd/identities/validate_test.go
Expand Up @@ -3,10 +3,12 @@ package identities
import (
"bytes"
"fmt"
"github.com/ory/kratos/internal/httpclient/client/common"
"testing"

"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"testing"

"github.com/ory/kratos/internal/httpclient/client/common"
)

func TestValidateIdentity(t *testing.T) {
Expand All @@ -23,28 +25,28 @@ func TestValidateIdentity(t *testing.T) {
}
}

for i, tc := range []struct{
description string
payload string
for i, tc := range []struct {
description string
payload string
expectedRequiredError string
identitySchema map[string]interface{}
identitySchema map[string]interface{}
}{
{
description: "requires schema_id from swagger schema",
payload: "{}",
description: "requires schema_id from swagger schema",
payload: "{}",
expectedRequiredError: "schema_id",
},
{
description: "requires traits from swagger schema",
payload: `{"schema_id": "case2"}`,
description: "requires traits from swagger schema",
payload: `{"schema_id": "case2"}`,
expectedRequiredError: "traits",
},
{
description: "requires custom trait key",
payload: `{"schema_id": "case3", "traits": {}}`,
description: "requires custom trait key",
payload: `{"schema_id": "case3", "traits": {}}`,
expectedRequiredError: "random-property",
identitySchema: map[string]interface{}{
"type": "object",
"type": "object",
"required": []string{"random-property"},
"properties": map[string]interface{}{
"random-property": map[string]interface{}{
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/cli/kratos-identities-delete.md
Expand Up @@ -24,7 +24,7 @@ with jq. Example: delete the identity with the recovery email address
kratos identities delete \$(kratos identities list --format json | jq -r
'map(select(.recovery_addresses[].value == "foo@bar.com")) | .[].id')

I have to admit, this is not easy if you don't speak jq fluently. What about
We have to admit, this is not easy if you don't speak jq fluently. What about
opening an issue and telling us what predefined selectors you want to have?
https://github.com/ory/kratos/issues/new/choose

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/cli/kratos-identities-get.md
Expand Up @@ -24,7 +24,7 @@ domain "ory.sh":
kratos identities get \$(kratos identities list --format json | jq -r
'map(select(.recovery_addresses[].value | endswith("@ory.sh"))) | .[].id')

I have to admit, this is not easy if you don't speak jq fluently. What about
We have to admit, this is not easy if you don't speak jq fluently. What about
opening an issue and telling us what predefined selectors you want to have?
https://github.com/ory/kratos/issues/new/choose

Expand Down
9 changes: 6 additions & 3 deletions docs/docs/cli/kratos-identities-import.md
Expand Up @@ -9,13 +9,16 @@ This file is auto-generated.
To improve this file please make your change against the appropriate "./cmd/*.go" file.
-->

## kratos identities import

import identities from files or STD_IN

### Synopsis

Import identities from files or STD_IN. Files are expected to each contain a single identity. The validity of files can be tested beforehand using `... identities validate`. Importing credentials is not yet supported.
Import identities from files or STD_IN. Files are expected to each contain a
single identity. The validity of files can be tested beforehand using
`... identities validate`. Importing credentials is not yet supported.

```
kratos identities import <file.json [file-2.json [file-3.json] ...]> [flags]
Expand All @@ -37,5 +40,5 @@ kratos identities import <file.json [file-2.json [file-3.json] ...]> [flags]

### SEE ALSO

* [kratos identities](kratos-identities) - Tools to interact with remote identities

- [kratos identities](kratos-identities) - Tools to interact with remote
identities
4 changes: 2 additions & 2 deletions docs/docs/cli/kratos-identities.md
Expand Up @@ -33,10 +33,10 @@ Tools to interact with remote identities
- [kratos identities delete](kratos-identities-delete) - Delete identities by ID
- [kratos identities get](kratos-identities-get) - Get one or more identities by
ID
- [kratos identities import](kratos-identities-import) - import identities from
files or STD_IN
- [kratos identities list](kratos-identities-list) - List identities
- [kratos identities patch](kratos-identities-patch) - Patch identities by ID
(not yet implemented)
- [kratos identities put](kratos-identities-put) - Put identities from files or
STD_IN
- [kratos identities validate](kratos-identities-validate) - Validate local
identity files
50 changes: 27 additions & 23 deletions docs/docs/contributing.md
Expand Up @@ -13,13 +13,11 @@ https://github.com/ory/meta/blob/master/templates/repository/CONTRIBUTING.md
-->


# Contributing to ORY {{Project}}

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Introduction](#introduction)
- [Contributing Code](#contributing-code)
- [Disclosing vulnerabilities](#disclosing-vulnerabilities)
Expand Down Expand Up @@ -88,7 +86,8 @@ Please follow these guidelines when formatting source code:
Please provide documentation when changing, removing, or adding features.
Documentation resides in the project's `docs` folder.

In cases where a project does not have a `docs` folder check the README for instructions.
In cases where a project does not have a `docs` folder check the README for
instructions.

The commands listed below work exclusively for projects with a `docs` folder

Expand All @@ -110,8 +109,8 @@ To start a local development server with hot reloading, run:
$ npm start
```

This command opens up a browser window. Please note that changes to the sidebar are not hot-reloaded
and require a restart of the command.
This command opens up a browser window. Please note that changes to the sidebar
are not hot-reloaded and require a restart of the command.

#### Build

Expand Down Expand Up @@ -148,27 +147,32 @@ please include a note in your commit message explaining why.

## How We Organize Our Work

All repositories in the [ORY organization](https://github.com/ory) have their issues and pull requests
monitored in the [ORY Monitoring Board](https://github.com/orgs/ory/projects/9). This allows
for a transparent backlog of unanswered issues and pull requests across the ecosystem from those
who are allowed to merge pull requests to the main branch.
All repositories in the [ORY organization](https://github.com/ory) have their
issues and pull requests monitored in the
[ORY Monitoring Board](https://github.com/orgs/ory/projects/9). This allows for
a transparent backlog of unanswered issues and pull requests across the
ecosystem from those who are allowed to merge pull requests to the main branch.

The process is as follows:

1. *Cards* represent open issues and pull requests and are automatically assigned to the **Triage** column if
the author is not one of the maintainers and no maintainer has answered yet.
2. A maintainer assigns the issue or pull request to someone or adds the label *help wanted*
which moves the card to **Requires Action**.
3. If a maintainer leaves a comment or review, the card moves to **Pending Reply**, implying that
the original author needs to do something (e.g. implement a change, explain something in more detail, ...).
4. If a non-maintainer pushes changes to the pull request or leaves a comment, the card moves
back to **Requires Action**.
5. If a card stays inactive for 60 days or more days, we assume that public interest in the issue
or change has waned, **archiving** the card.
6. If the issue is closed or the pull request merged or closed, the card is **archived** as well.

We try our best to answer all issues and review all pull requests and hope that this transparent way
of keeping a backlog helps you better understand how heavy the workload is.
1. _Cards_ represent open issues and pull requests and are automatically
assigned to the **Triage** column if the author is not one of the maintainers
and no maintainer has answered yet.
2. A maintainer assigns the issue or pull request to someone or adds the label
_help wanted_ which moves the card to **Requires Action**.
3. If a maintainer leaves a comment or review, the card moves to **Pending
Reply**, implying that the original author needs to do something (e.g.
implement a change, explain something in more detail, ...).
4. If a non-maintainer pushes changes to the pull request or leaves a comment,
the card moves back to **Requires Action**.
5. If a card stays inactive for 60 days or more days, we assume that public
interest in the issue or change has waned, **archiving** the card.
6. If the issue is closed or the pull request merged or closed, the card is
**archived** as well.

We try our best to answer all issues and review all pull requests and hope that
this transparent way of keeping a backlog helps you better understand how heavy
the workload is.

## Communication

Expand Down

0 comments on commit 7a1ac3d

Please sign in to comment.