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

fix: openapi spec and internal SDK #819

Merged
merged 2 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions internal/e2e/sdk_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (c *sdkClient) getWriteClient() *httpclient.OryKeto {

func (c *sdkClient) createTuple(t require.TestingT, r *relationtuple.InternalRelationTuple) {
payload := &models.RelationQuery{
Namespace: &r.Namespace,
Namespace: r.Namespace,
Object: r.Object,
Relation: r.Relation,
}
Expand All @@ -76,7 +76,7 @@ func (c *sdkClient) createTuple(t require.TestingT, r *relationtuple.InternalRel
}

func (c *sdkClient) deleteTuple(t require.TestingT, r *relationtuple.InternalRelationTuple) {
params := write.NewDeleteRelationTupleParamsWithTimeout(time.Second).
params := write.NewDeleteRelationTuplesParamsWithTimeout(time.Second).
WithNamespace(&r.Namespace).
WithObject(&r.Object).
WithRelation(&r.Relation)
Expand All @@ -90,12 +90,12 @@ func (c *sdkClient) deleteTuple(t require.TestingT, r *relationtuple.InternalRel
WithSubjectSetRelation(&s.Relation)
}

_, err := c.getWriteClient().Write.DeleteRelationTuple(params)
_, err := c.getWriteClient().Write.DeleteRelationTuples(params)
require.NoError(t, err)
}

func (c *sdkClient) deleteAllTuples(t require.TestingT, q *relationtuple.RelationQuery) {
params := write.NewDeleteRelationTupleParamsWithTimeout(time.Second).
params := write.NewDeleteRelationTuplesParamsWithTimeout(time.Second).
WithNamespace(&q.Namespace).
WithObject(&q.Object).
WithRelation(&q.Relation)
Expand All @@ -112,7 +112,7 @@ func (c *sdkClient) deleteAllTuples(t require.TestingT, q *relationtuple.Relatio
}
}

_, err := c.getWriteClient().Write.DeleteRelationTuple(params)
_, err := c.getWriteClient().Write.DeleteRelationTuples(params)
require.NoError(t, err)
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/relationtuple/transact_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type bodyRelationTuple struct {

// The basic ACL relation tuple
//
// swagger:parameters getCheck deleteRelationTuple
// swagger:parameters getCheck deleteRelationTuples
// nolint:deadcode,unused
type queryRelationTuple struct {
// Namespace of the Relation Tuple
Expand Down
44 changes: 44 additions & 0 deletions spec/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,50 @@
],
"summary": "Delete Relation Tuples",
"operationId": "deleteRelationTuples",
"parameters": [
{
"type": "string",
"description": "Namespace of the Relation Tuple",
"name": "namespace",
"in": "query"
},
{
"type": "string",
"description": "Object of the Relation Tuple",
"name": "object",
"in": "query"
},
{
"type": "string",
"description": "Relation of the Relation Tuple",
"name": "relation",
"in": "query"
},
{
"type": "string",
"description": "SubjectID of the Relation Tuple",
"name": "subject_id",
"in": "query"
},
{
"type": "string",
"description": "Namespace of the Subject Set",
"name": "subject_set.namespace",
"in": "query"
},
{
"type": "string",
"description": "Object of the Subject Set",
"name": "subject_set.object",
"in": "query"
},
{
"type": "string",
"description": "Relation of the Subject Set",
"name": "subject_set.relation",
"in": "query"
}
],
"responses": {
"204": {
"description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201."
Expand Down