搜索插件、代码仓与 APP 分类

插件详情v1.22.22

ory_client

Ory Network 的 OpenAPI API 客户端,Ory 的 Web 规模身份和访问控制 API。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
2030
喜欢数
11
Pub 分数
125

安装插件

flutter pub add ory_client

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

ory_client 包是用于与 Ory Network(一个可扩展的身份和访问控制平台)交互的 Flutter/Dart OpenAPI 生成 SDK。它使 Flutter 应用能够直接实现安全的身份验证、授权和用户管理。该客户端支持所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,确保在不同环境中保持一致的身份工作流。该包基于 Ory 的官方 OpenAPI 规范构建,提供类型安全的自动生成 API,可无缝集成 Ory 的身份服务,如 Hydra、Kratos 和 Oathkeeper。

适合场景

  • 移动和Web应用中的用户身份验证
  • 使用 OAuth2 和 OIDC 实现安全的 API 访问
  • 自助身份管理
  • 与 Ory Kratos 的注册和登录集成
  • 基于角色的访问控制(RBAC)执行

主要特点

  • 类型安全的 OpenAPI 生成的 API
  • 跨平台支持(Android、iOS、Web、macOS、Windows、Linux)
  • 内置对 OAuth2、OIDC 和会话管理的支持
  • 自动生成的模型和端点
  • 轻松集成 Ory 身份与访问控制服务

适合对象

  • 开发具有身份验证需求的安全 Flutter 应用的开发者
  • 使用 Ory Network 作为身份基础设施的团队
  • 需要自助用户注册和登录的应用程序
  • 需要可扩展访问控制的项目
  • 与现有 Ory 后端系统的集成

使用建议

  • 需要一个 Ory Network 实例或托管服务
  • 需要正确配置 API 端点和凭据
  • 依赖于 Ory 的 OpenAPI 规范版本
  • 可能需要额外的状态管理来处理会话
  • 最佳搭配 Ory Kratos 和 Hydra 使用以获得完整功能

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Generated SDKs for the Ory Ecosystem

All SDKs provided in this repository are generated using openapi-generator.

Ory Network SDKs

When developing against Ory Network, use the latest client or ory-client SDK for your preferred language. It bundles the individual SDKs (Identities, OAuth2, Permissions) and works with Ory API keys.

Ory self-hosted SDKs

When developing against self-hosted Ory components (Kratos, Hydra, Keto), use the corresponding individual SDKs for your language and match the SDK version to the version of Kratos/Hydra/Keto you have deployed.

Publish the Docker Image

To publish the SDK Builder Docker Image, create a new GitHub release with the desired version.

You may also manually build and publish this image using:

docker build --platform linux/adm64 -t oryd/sdk:latest .
docker tag oryd/sdk:latest oryd/sdk:v0.0.53
docker push oryd/sdk:v0.0.53

Running the Image Locally

If you wish to debug some generators or build steps, you can run the image locally:

docker build -t oryd/sdk:latest .
docker run --mount type=bind,source="$(pwd)",target=/project --name sdk --user "$(id -u):$(id -g)" -it oryd/sdk:latest /bin/sh
Debugging Failing Tests on CI

If a test fails in CI, you may run the following code snippet to reproduce the failure locally:

docker build -t oryd/sdk:latest .
docker run --rm --mount type=bind,source="$(pwd)",target=/project --name sdk -it oryd/sdk:latest /bin/bash

export FORCE_PROJECT=client # or hydra or something else
export FORCE_VERSION=$(cat /project/spec/$FORCE_PROJECT/latest) # or a specific version, e.g. v1.2.17
cd /project

./scripts/generate.sh
./scripts/test.sh

Commit a new spec

Place the spec in spec/<project>/<version>.json (e.g. spec/hydra/v0.0.0-alpha.1.json) and create a commit that references both the project and the version git commit -a -m "Add spec for <project>:<version>" (e.g. git commit -a -m "Add spec for hydra:v0.0.0-alpha.1").

Do not create multiple commits adding several specs in one PR, as only the latest commit will be checked when it lands on master.

Because this is an automated process, it is highly recommended to add, commit, and push the spec file directly to master in one go!

You can create a PR if you're making changes to the build chain.

Upgrading OpenAPI Generator

Upgrading OpenAPI Generator versions requires careful upgrading of the Java pom.xml. The file might contain new versions for dependencies, but if overwritten, will not work with the release pipeline.

Therefore, the pom.xml file is being always overwritten from the contrib/poms directory for each project. To update any dependencies, the changes must thus be made there. We recommend running the openapi generator manually on the local machine and diffing the changes with contents in contrib/poms.

Publishing

PHP - Packagist

Install PHP and composer. Then, run the install command to initialize everything:

export PROJECT=hydra
cd clients/${PROJECT}/php
composer install

Then, push the directory to a git remote of your choosing and also publish the tag you want to release the package as. You can take a look at ./scripts/publish.sh to understand how to accomplish that.

Python - PyPi / pip

First, install all the necessary tools and python3:

python3 -m pip install --user --upgrade setuptools wheel twine

Next, create a PyPi account and API Token and set the env vars to:

export TWINE_USERNAME=__token__
export TWINE_PASSWORD=<token>

Then, publish the project (and set the project name):

export PROJECT=hydra
cd clients/${PROJECT}/python
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*

Ruby

You need to set GEM_HOST_API_KEY

Java - Maven Central

For keys read https://blackdoor.github.io/blog/maven-cd/

Due to a bug in openapi-generator that appears in Java11+, please disable javadoc generation:

mvn <cmd> -Dmaven.javadoc.skip=true

To test the build for Java, run:

$ ./scripts/generate.sh
$ cd clients/<project>/java
$ mvn test-compile

You will also need a PGP keypair that is associated with one of the owners of the sh.ory group and that is published on one of the public key servers. For more details, see: https://dzone.com/articles/publish-your-artifacts-to-maven-central

or execute these steps:

gpg --full-gen-key
> Select RSA and RSA
> 4096
> 0 (does not expire)

# The key ID is the pub key ID
> gpg –keyserver keys.pgp.net –send-key [KEY_ID]

On macOS, use GPG Keychain as gpg --full-gen-key may run into issues.

  1. Use this value for MVN_GPG_ASC_BASE64: gpg --pinentry-mode loopback --export-secret-keys --armor $MVN_PGP_KEY_ID | base64 -w0 | pbcopy
  2. Set MVN_PGP_KEY_ID to the value of the key ID (on MacOS you can find it in the info section of GPG Keychain).
  3. Set MVN_PGP_KEYNAME to the value of the public key fingerprint.
  4. Set MVN_PGP_PASSPHRASE to the passphrase of the private key.

Then, run the following commands:

mvn clean

# THESE VALUES ARE EXAMPLES - PLEASE PICK THE APPROPRIATE `tag`, etc
mvn -Dtag=client-0.0.1-alpha.1 release:update-version \
  -DreleaseVersion=0.0.1-alpha.1 -DdevelopmentVersion=0.0.1-alpha.1-SNAPSHOT \
  -Darguments="-Dmaven.javadoc.skip=true" -Dresume=false

mvn release:perform -Darguments="-Dmaven.javadoc.skip=true" -Dresume=false

所属分类

依赖

依赖清单 5 项

源码仓库

使用此插件的项目

暂无相关数据。