worried-journalist-71921
06/26/2024, 9:27 AMchilly-king-10285
06/26/2024, 9:27 AMchilly-king-10285
06/26/2024, 9:28 AMGET /workspaces
API lists the workspaces a user is a member of, and the GET /workspaces/{workspace}
API retrieves a specific workspace. These APIs might return workspace IDs in their responses. You would need to authenticate these requests using a method like oryNetworkCookie
. Please refer to the [Ory API documentation](https://www.ory.sh/docs/reference/api) for more details.worried-journalist-71921
06/26/2024, 9:28 AMworried-journalist-71921
06/26/2024, 9:28 AMchilly-king-10285
06/26/2024, 9:28 AMchilly-king-10285
06/26/2024, 9:28 AMGET /workspaces
API to list all the workspaces you are a member of. Each workspace in the response should have an ID. Here is the structure of the API endpoint: GET /workspaces/{workspace}
In this endpoint, {workspace}
is a placeholder for the workspace ID. This API endpoint returns a workspace object that includes the workspace ID. Please note that you need to be authenticated to access this endpoint. You can authenticate using methods like oryNetworkCookie
. For more details, please refer to the [Ory API documentation](https://www.ory.sh/docs/reference/api).worried-journalist-71921
06/26/2024, 9:29 AMworried-journalist-71921
06/26/2024, 9:29 AMchilly-king-10285
06/26/2024, 9:29 AMchilly-king-10285
06/26/2024, 9:29 AMworried-journalist-71921
06/26/2024, 9:39 AMchilly-king-10285
06/26/2024, 9:39 AMchilly-king-10285
06/26/2024, 9:39 AM<version-you-want>
with the specific version of the SDK you want to install when using the go get
command.worried-journalist-71921
06/26/2024, 9:39 AMchilly-king-10285
06/26/2024, 9:39 AMchilly-king-10285
06/26/2024, 9:40 AMbash go get <http://github.com/ory/client-go|github.com/ory/client-go>
For more information on how to use the Go SDK, you can refer to the [Ory SDK documentation](https://www.ory.sh/docs/sdk).worried-journalist-71921
06/26/2024, 9:41 AMchilly-king-10285
06/26/2024, 9:41 AMchilly-king-10285
06/26/2024, 9:41 AMworried-journalist-71921
06/26/2024, 9:43 AMchilly-king-10285
06/26/2024, 9:43 AMchilly-king-10285
06/26/2024, 9:44 AMworried-journalist-71921
06/26/2024, 9:59 AMworried-journalist-71921
06/26/2024, 10:00 AMchilly-king-10285
06/26/2024, 10:00 AMchilly-king-10285
06/26/2024, 10:00 AMhttps://{project-slug}.<http://projects.oryapis.com/|projects.oryapis.com/>
as per the [Ory API documentation](https://www.ory.sh/docs/reference/api). Ensure that you're using the correct project slug in the URL and that the endpoint you're trying to access exists. If you're trying to create a project, the correct endpoint should be POST /projects
as per the [Ory API documentation](https://www.ory.sh/docs/reference/api). If you're still having issues, it might be helpful to check the [Ory SDK documentation](https://github.com/ory/sdk/blob/master/clients/client/go/docs/ProjectAPI.md#createproject) and ensure that you're following the instructions correctly.worried-journalist-71921
06/26/2024, 10:16 AMchilly-king-10285
06/26/2024, 10:16 AMchilly-king-10285
06/26/2024, 10:16 AMtypescript class User implements Namespace {} class Group implements Namespace { related: { members: User[] } }
In this example, User
and Group
are namespaces. The Group
namespace has a members
relationship that is an array of User
objects. This means that a group can have multiple users as members. You can also define permissions based on these relationships. For example, you can check if a user is a member of a group: typescript class Group implements Namespace { related: { members: User[] } permits = { isMember: (ctx: Context): boolean => this.related.members.includes(ctx.subject), } }
In this example, the isMember
permission checks if a user (the subject in the context) is a member of the group. For more information, you can refer to the [Ory Permission Language documentation](https://www.ory.sh/docs/keto/reference/ory-permission-language).worried-journalist-71921
06/26/2024, 10:19 AMchilly-king-10285
06/26/2024, 10:19 AMchilly-king-10285
06/26/2024, 10:19 AMoryNetworkCookie
. Please refer to the [Ory API documentation](https://www.ory.sh/docs/reference/api) for more details. For more specific guidance, you may need to refer to the specific documentation for the Go SDK you are using or reach out to Ory support.worried-journalist-71921
06/26/2024, 10:23 AMimport { Namespace, Context, SubjectSet } from "@ory/keto-namespace-types"
// <https://www.ory.sh/docs/keto/concepts/namespaces>
class User implements Namespace {}
class AdminGroup implements Namespace {
related: {
members: User[]
}
permits = {
isMember: (ctx: Context): boolean => this.related.members.includes(ctx.subject),
}
}
class DefaultGroup implements Namespace {
related: {
members: User[]
}
permits = {
isMember: (ctx: Context): boolean => this.related.members.includes(ctx.subject),
}
}
how can create relationship to add identity as part of the members of AdminGroup using go SDKchilly-king-10285
06/26/2024, 10:23 AMchilly-king-10285
06/26/2024, 10:23 AMoryNetworkCookie
. Please refer to the [Ory API documentation](https://www.ory.sh/docs/reference/api) for more details. For more specific guidance, you may need to refer to the specific documentation for the Go SDK you are using or reach out to Ory support.worried-journalist-71921
06/26/2024, 10:24 AMworried-journalist-71921
06/26/2024, 10:24 AMchilly-king-10285
06/26/2024, 10:24 AMchilly-king-10285
06/26/2024, 10:24 AMory create relationships
command. This command allows you to create relationships from JSON files. Here is the basic usage: bash ory create relationships [flags]
You can pass the special filename -
to read from STD_IN. Here are some of the options you can use with this command: bash --authority string Set the authority header for the remote gRPC server. --block Block until the connection is up. --format string Set the output format. One of table, json, yaml, json-pretty, jsonpath and jsonpointer. (default "default") -h, --help help for relationships --project string The project to use, either project ID or a (partial) slug. -q, --quiet Be quiet with output printing.
For example, if you have a JSON file named relationships.json
that defines your relationships, you can create these relationships in Ory Permissions by running this command: bash ory create relationships relationships.json
For more information, you can refer to the [Ory CLI documentation](https://www.ory.sh/docs/cli/ory-create-relationships#ory-create-relationships).