fusionauth_client 1.49.1 → 1.51.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/fusionauth/.env +6 -0
- data/.github/fusionauth/docker-compose.yml +51 -0
- data/.github/fusionauth/kickstart.json +46 -0
- data/.github/workflows/deploy.yaml +87 -0
- data/.github/workflows/docs.yml +31 -0
- data/.github/workflows/test.yml +33 -0
- data/.ruby-version +1 -1
- data/Gemfile +5 -6
- data/Gemfile.lock +20 -23
- data/README.md +225 -0
- data/build.savant +3 -3
- data/doc/FusionAuth/FusionAuthClient.html +14185 -0
- data/doc/FusionAuth/FusionAuthClient.md +197 -80
- data/doc/FusionAuth.html +108 -0
- data/doc/FusionAuth.md +1 -1
- data/doc/created.rid +2 -2
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +619 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +89 -0
- data/doc/js/darkfish.js +84 -0
- data/doc/js/navigation.js +105 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +110 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +229 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +1765 -0
- data/fusionauth-ruby-client.iml +1 -4
- data/fusionauth_client.gemspec +2 -2
- data/lib/fusionauth/fusionauth_client.rb +84 -1
- data/lib/fusionauth/rest_client.rb +1 -1
- metadata +56 -5
- data/README.adoc +0 -106
- data/doc/index.db +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13fca66205c78f0e7713d67c9472b5b644b08666f2b0ff69b46997bb7d828511
|
4
|
+
data.tar.gz: b56c7c13048361ef7907e182710ca2c96182a28f446f5a7012ed9837c8c98e5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcf912401674250d3ce13a698b8579fa388b75b54823ecae30b9c073af9aaa15b93851a854578664b30a6eccd4d37cc109cf9a4dec11702776dbe9347403d0c6
|
7
|
+
data.tar.gz: 40c42731f45e9c80d8b0fa8cad3b757db9f01c7077e1f6911bb932274589d18184925ebc37fbd419b1d8035803dee7ebd1938773a8f5aa796f78aafb3a3959b5
|
@@ -0,0 +1,51 @@
|
|
1
|
+
services:
|
2
|
+
db:
|
3
|
+
image: postgres:16.0-alpine
|
4
|
+
environment:
|
5
|
+
PGDATA: /var/lib/postgresql/data/pgdata
|
6
|
+
POSTGRES_USER: ${POSTGRES_USER}
|
7
|
+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
8
|
+
healthcheck:
|
9
|
+
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
|
10
|
+
interval: 5s
|
11
|
+
timeout: 5s
|
12
|
+
retries: 5
|
13
|
+
networks:
|
14
|
+
- db_net
|
15
|
+
restart: unless-stopped
|
16
|
+
volumes:
|
17
|
+
- db_data:/var/lib/postgresql/data
|
18
|
+
|
19
|
+
fusionauth:
|
20
|
+
image: fusionauth/fusionauth-app:latest
|
21
|
+
depends_on:
|
22
|
+
db:
|
23
|
+
condition: service_healthy
|
24
|
+
environment:
|
25
|
+
DATABASE_URL: jdbc:postgresql://db:5432/fusionauth
|
26
|
+
DATABASE_ROOT_USERNAME: ${POSTGRES_USER}
|
27
|
+
DATABASE_ROOT_PASSWORD: ${POSTGRES_PASSWORD}
|
28
|
+
DATABASE_USERNAME: ${DATABASE_USERNAME}
|
29
|
+
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
|
30
|
+
FUSIONAUTH_APP_MEMORY: ${FUSIONAUTH_APP_MEMORY}
|
31
|
+
FUSIONAUTH_APP_RUNTIME_MODE: ${FUSIONAUTH_APP_RUNTIME_MODE}
|
32
|
+
FUSIONAUTH_APP_SILENT_MODE: true
|
33
|
+
FUSIONAUTH_APP_URL: http://fusionauth:9011
|
34
|
+
FUSIONAUTH_APP_KICKSTART_FILE: /usr/local/fusionauth/kickstart.json
|
35
|
+
SEARCH_TYPE: database
|
36
|
+
networks:
|
37
|
+
- db_net
|
38
|
+
restart: unless-stopped
|
39
|
+
ports:
|
40
|
+
- 9011:9011
|
41
|
+
volumes:
|
42
|
+
- fusionauth_config:/usr/local/fusionauth/config
|
43
|
+
- ./kickstart.json:/usr/local/fusionauth/kickstart.json
|
44
|
+
|
45
|
+
networks:
|
46
|
+
db_net:
|
47
|
+
driver: bridge
|
48
|
+
|
49
|
+
volumes:
|
50
|
+
db_data:
|
51
|
+
fusionauth_config:
|
@@ -0,0 +1,46 @@
|
|
1
|
+
{
|
2
|
+
"variables": {
|
3
|
+
"applicationId": "3c219e58-ed0e-4b18-ad48-f4f92793ae32",
|
4
|
+
"apiKey": "72a8c464b86c3c9098c33da73f471b8a0352f6e14087ddc3",
|
5
|
+
"asymmetricKeyId": "#{UUID()}",
|
6
|
+
"defaultTenantId": "d7d09513-a3f5-401c-9685-34ab6c552453",
|
7
|
+
"adminEmail": "admin@example.com",
|
8
|
+
"adminPassword": "password"
|
9
|
+
},
|
10
|
+
"apiKeys": [
|
11
|
+
{
|
12
|
+
"key": "#{apiKey}",
|
13
|
+
"description": "Unrestricted API key"
|
14
|
+
}
|
15
|
+
],
|
16
|
+
"requests": [
|
17
|
+
{
|
18
|
+
"method": "POST",
|
19
|
+
"url": "/api/key/generate/#{asymmetricKeyId}",
|
20
|
+
"tenantId": "#{defaultTenantId}",
|
21
|
+
"body": {
|
22
|
+
"key": {
|
23
|
+
"algorithm": "RS256",
|
24
|
+
"name": "For GitHub Actions",
|
25
|
+
"length": 2048
|
26
|
+
}
|
27
|
+
}
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"method": "POST",
|
31
|
+
"url": "/api/user/registration",
|
32
|
+
"body": {
|
33
|
+
"user": {
|
34
|
+
"email": "#{adminEmail}",
|
35
|
+
"password": "#{adminPassword}"
|
36
|
+
},
|
37
|
+
"registration": {
|
38
|
+
"applicationId": "#{applicationId}",
|
39
|
+
"roles": [
|
40
|
+
"admin"
|
41
|
+
]
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
]
|
46
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# Run locally with act:
|
2
|
+
#
|
3
|
+
# act pull_request [--input command=[command]] \
|
4
|
+
# --platform fusionauth-builder=[ecr-repo-name]/fusionauth-builder:latest] \
|
5
|
+
# --workflows ./.github/workflows/release.yaml \
|
6
|
+
# --env-file <(aws configure export-credentials --profile [aws-profile] --format env)
|
7
|
+
|
8
|
+
name: Deploy
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches:
|
13
|
+
- main
|
14
|
+
pull_request:
|
15
|
+
branches:
|
16
|
+
- main
|
17
|
+
workflow_dispatch:
|
18
|
+
inputs:
|
19
|
+
command:
|
20
|
+
type: choice
|
21
|
+
options:
|
22
|
+
- build # build only
|
23
|
+
- publish # build & publish to rubygems
|
24
|
+
- release # build & release to svn
|
25
|
+
default: build
|
26
|
+
|
27
|
+
permissions:
|
28
|
+
contents: read
|
29
|
+
|
30
|
+
jobs:
|
31
|
+
build:
|
32
|
+
if: |
|
33
|
+
github.event_name == 'pull_request' ||
|
34
|
+
github.event_name == 'push' ||
|
35
|
+
github.event_name == 'workflow_dispatch' && inputs.command == 'build'
|
36
|
+
runs-on: fusionauth-builder
|
37
|
+
steps:
|
38
|
+
- name: checkout
|
39
|
+
uses: actions/checkout@v4
|
40
|
+
|
41
|
+
- name: compile
|
42
|
+
shell: bash -l {0}
|
43
|
+
run: sb compile
|
44
|
+
|
45
|
+
deploy:
|
46
|
+
if: |
|
47
|
+
github.event_name == 'workflow_dispatch' &&
|
48
|
+
(inputs.command == 'release' || inputs.command == 'publish')
|
49
|
+
runs-on: fusionauth-builder
|
50
|
+
steps:
|
51
|
+
- name: checkout
|
52
|
+
uses: actions/checkout@v4
|
53
|
+
|
54
|
+
- name: set aws credentials
|
55
|
+
uses: aws-actions/configure-aws-credentials@v4
|
56
|
+
with:
|
57
|
+
role-to-assume: arn:aws:iam::752443094709:role/github-actions
|
58
|
+
role-session-name: aws-auth-action
|
59
|
+
aws-region: us-west-2
|
60
|
+
|
61
|
+
- name: get secret
|
62
|
+
run: |
|
63
|
+
while IFS=$'\t' read -r key value; do
|
64
|
+
echo "::add-mask::${value}"
|
65
|
+
echo "${key}=${value}" >> $GITHUB_ENV
|
66
|
+
done < <(aws secretsmanager get-secret-value \
|
67
|
+
--region us-west-2 \
|
68
|
+
--secret-id platform/rubygems \
|
69
|
+
--query SecretString \
|
70
|
+
--output text | \
|
71
|
+
jq -r 'to_entries[] | [.key, .value] | @tsv')
|
72
|
+
|
73
|
+
- name: set gem credentials
|
74
|
+
run: |
|
75
|
+
mkdir -p ~/.gem
|
76
|
+
echo ":rubygems_api_key: ${{ env.API_KEY }}" > ~/.gem/credentials
|
77
|
+
chmod 600 ~/.gem/credentials
|
78
|
+
|
79
|
+
- name: release to svn
|
80
|
+
if: inputs.command == 'release'
|
81
|
+
shell: bash -l {0}
|
82
|
+
run: sb release
|
83
|
+
|
84
|
+
- name: publish to rubygems
|
85
|
+
if: inputs.command == 'publish'
|
86
|
+
shell: bash -l {0}
|
87
|
+
run: sb publish
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: Generate Docs
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
|
8
|
+
permissions:
|
9
|
+
contents: write
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
build:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v4
|
16
|
+
|
17
|
+
- name: Set up Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
bundler-cache: true
|
21
|
+
|
22
|
+
- name: Generate docs
|
23
|
+
run: |
|
24
|
+
rm -f doc/index.db
|
25
|
+
rdoc --format=markdown lib/fusionauth/fusionauth_client.rb
|
26
|
+
|
27
|
+
- name: Commit
|
28
|
+
uses: EndBug/add-and-commit@v9
|
29
|
+
with:
|
30
|
+
add: 'doc/'
|
31
|
+
message: ':memo: Updating docs'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Test Library
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- main
|
10
|
+
|
11
|
+
permissions:
|
12
|
+
contents: read
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
build:
|
16
|
+
runs-on: ubuntu-latest
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v4
|
19
|
+
|
20
|
+
- name: Set up FusionAuth
|
21
|
+
working-directory: .github/fusionauth
|
22
|
+
run: docker compose up -d
|
23
|
+
|
24
|
+
- name: Set up Ruby
|
25
|
+
uses: ruby/setup-ruby@v1
|
26
|
+
with:
|
27
|
+
bundler-cache: true
|
28
|
+
|
29
|
+
- name: Waiting for FusionAuth App
|
30
|
+
run: timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9011)" != "200" ]]; do sleep 5; done' || false
|
31
|
+
|
32
|
+
- name: Run test suite
|
33
|
+
run: rake test
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5
|
1
|
+
2.7.5
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2019-
|
1
|
+
# Copyright (c) 2019-2024, FusionAuth, All Rights Reserved
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -13,12 +13,11 @@
|
|
13
13
|
# language governing permissions and limitations under the License.
|
14
14
|
|
15
15
|
source 'https://rubygems.org'
|
16
|
-
ruby '2.5
|
16
|
+
ruby '2.7.5'
|
17
17
|
|
18
|
-
gem
|
19
|
-
gem
|
18
|
+
gem 'minitest', '~> 5.22', '>= 5.22.3'
|
19
|
+
gem 'rake', '~> 13.2', '>= 13.2.1'
|
20
|
+
gem 'rdoc-markdown', '~> 0.4.2'
|
20
21
|
|
21
22
|
# Specify your gem's dependencies in fusionauth_client.gemspec
|
22
23
|
gemspec
|
23
|
-
|
24
|
-
gem "rdoc-markdown", "~> 0.4"
|
data/Gemfile.lock
CHANGED
@@ -1,31 +1,29 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fusionauth_client (1.
|
4
|
+
fusionauth_client (1.51.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
cgi (0.
|
9
|
+
cgi (0.4.1)
|
10
10
|
erb (2.2.3)
|
11
11
|
cgi
|
12
|
-
extralite-bundle (1.
|
13
|
-
|
14
|
-
|
15
|
-
nokogiri (1.13.10)
|
16
|
-
mini_portile2 (~> 2.8.0)
|
12
|
+
extralite-bundle (1.27)
|
13
|
+
minitest (5.22.3)
|
14
|
+
nokogiri (1.15.6-aarch64-linux)
|
17
15
|
racc (~> 1.4)
|
18
|
-
nokogiri (1.
|
16
|
+
nokogiri (1.15.6-arm64-darwin)
|
19
17
|
racc (~> 1.4)
|
20
|
-
nokogiri (1.
|
18
|
+
nokogiri (1.15.6-x86_64-linux)
|
21
19
|
racc (~> 1.4)
|
22
|
-
psych (5.
|
20
|
+
psych (5.1.2)
|
23
21
|
stringio
|
24
|
-
racc (1.
|
25
|
-
rake (
|
26
|
-
rdoc (6.
|
22
|
+
racc (1.7.3)
|
23
|
+
rake (13.2.1)
|
24
|
+
rdoc (6.6.3.1)
|
27
25
|
psych (>= 4.0.0)
|
28
|
-
rdoc-markdown (0.4)
|
26
|
+
rdoc-markdown (0.4.2)
|
29
27
|
erb (~> 2.0)
|
30
28
|
extralite-bundle (~> 1.0)
|
31
29
|
rdoc (~> 6.0)
|
@@ -33,23 +31,22 @@ GEM
|
|
33
31
|
unindent (~> 1.0)
|
34
32
|
reverse_markdown (2.1.1)
|
35
33
|
nokogiri
|
36
|
-
stringio (3.0
|
34
|
+
stringio (3.1.0)
|
37
35
|
unindent (1.0)
|
38
36
|
|
39
37
|
PLATFORMS
|
40
|
-
|
41
|
-
|
42
|
-
x86_64-darwin-20
|
38
|
+
aarch64-linux
|
39
|
+
arm64-darwin-23
|
43
40
|
x86_64-linux
|
44
41
|
|
45
42
|
DEPENDENCIES
|
46
43
|
fusionauth_client!
|
47
|
-
minitest (
|
48
|
-
rake (
|
49
|
-
rdoc-markdown (~> 0.4)
|
44
|
+
minitest (~> 5.22, >= 5.22.3)
|
45
|
+
rake (~> 13.2, >= 13.2.1)
|
46
|
+
rdoc-markdown (~> 0.4.2)
|
50
47
|
|
51
48
|
RUBY VERSION
|
52
|
-
ruby 2.7.
|
49
|
+
ruby 2.7.5p203
|
53
50
|
|
54
51
|
BUNDLED WITH
|
55
|
-
2.
|
52
|
+
2.4.22
|
data/README.md
ADDED
@@ -0,0 +1,225 @@
|
|
1
|
+
# FusionAuth Ruby Client ![semver 2.0.0 compliant](http://img.shields.io/badge/semver-2.0.0-brightgreen.svg?style=flat-square)
|
2
|
+
|
3
|
+
## Intro
|
4
|
+
|
5
|
+
<!--
|
6
|
+
tag::forDocSite[]
|
7
|
+
-->
|
8
|
+
|
9
|
+
This gem is the Ruby client library that helps connect Ruby applications
|
10
|
+
to the FusionAuth (<https://fusionauth.io>) Identity and User Management
|
11
|
+
platform.
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Add this line to your application’s Gemfile:
|
16
|
+
|
17
|
+
gem 'fusionauth_client'
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
gem install fusionauth_client
|
26
|
+
|
27
|
+
|
28
|
+
## Examples
|
29
|
+
|
30
|
+
### Set Up
|
31
|
+
|
32
|
+
First, you have to make sure you have a running FusionAuth instance. If you don't have one already, the easiest way to install FusionAuth is [via Docker](https://fusionauth.io/docs/get-started/download-and-install/docker), but there are [other ways](https://fusionauth.io/docs/get-started/download-and-install). By default, it'll be running on `localhost:9011`.
|
33
|
+
|
34
|
+
Then, you have to [create an API Key](https://fusionauth.io/docs/apis/authentication#managing-api-keys) in the admin UI to allow calling API endpoints.
|
35
|
+
|
36
|
+
You are now ready to use this library!
|
37
|
+
|
38
|
+
### Response Handling
|
39
|
+
|
40
|
+
After every request is made, you need to check for any errors and handle them. To avoid cluttering things up, we'll omit the error handling in the next examples, but you should do something like the following.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
require 'fusionauth/fusionauth_client'
|
44
|
+
require 'pp'
|
45
|
+
|
46
|
+
# actual code
|
47
|
+
|
48
|
+
def handle_response(response)
|
49
|
+
if response.was_successful
|
50
|
+
pp response.success_response
|
51
|
+
else
|
52
|
+
print "status: #{response.status}"
|
53
|
+
if response.exception
|
54
|
+
# if we can't connect
|
55
|
+
print response.exception
|
56
|
+
end
|
57
|
+
print response.error_response
|
58
|
+
exit 1
|
59
|
+
end
|
60
|
+
end
|
61
|
+
```
|
62
|
+
|
63
|
+
### Create the Client
|
64
|
+
|
65
|
+
To make requests to the API, first you need to create a `FusionAuthClient` instance with [the API Key created](https://fusionauth.io/docs/apis/authentication#managing-api-keys) and the server address where FusionAuth is running.
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
require 'fusionauth/fusionauth_client'
|
69
|
+
|
70
|
+
# Construct the FusionAuth Client
|
71
|
+
client = FusionAuth::FusionAuthClient.new(
|
72
|
+
'<paste the API Key you generated here>',
|
73
|
+
'http://localhost:9011' # or change this to whatever address FusionAuth is running on
|
74
|
+
)
|
75
|
+
```
|
76
|
+
|
77
|
+
### Create an Application
|
78
|
+
|
79
|
+
To create an [Application](https://fusionauth.io/docs/get-started/core-concepts/applications), use the `createApplication()` method.
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
response = client.create_application(
|
83
|
+
'', # Leave this empty to automatically generate the UUID
|
84
|
+
{
|
85
|
+
:application => {
|
86
|
+
:name => 'ChangeBank',
|
87
|
+
}
|
88
|
+
}
|
89
|
+
)
|
90
|
+
|
91
|
+
handle_response(response)
|
92
|
+
```
|
93
|
+
|
94
|
+
[Check the API docs for this endpoint](https://fusionauth.io/docs/apis/applications#create-an-application)
|
95
|
+
|
96
|
+
### Adding Roles to an Existing Application
|
97
|
+
|
98
|
+
To add [roles to an Application](https://fusionauth.io/docs/get-started/core-concepts/applications#roles), use `createApplicationRole()`.
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
response = client.create_application_role(
|
102
|
+
'd564255e-f767-466b-860d-6dcb63afe4cc', # Existing Application Id
|
103
|
+
'', # Role Id - Leave this empty to automatically generate the UUID
|
104
|
+
{
|
105
|
+
:role => {
|
106
|
+
:name => 'customer',
|
107
|
+
:description => 'Default role for regular customers',
|
108
|
+
:isDefault => true,
|
109
|
+
}
|
110
|
+
}
|
111
|
+
)
|
112
|
+
|
113
|
+
handle_response(response)
|
114
|
+
```
|
115
|
+
|
116
|
+
[Check the API docs for this endpoint](https://fusionauth.io/docs/apis/applications#create-an-application-role)
|
117
|
+
|
118
|
+
### Retrieve Application Details
|
119
|
+
|
120
|
+
To fetch details about an [Application](https://fusionauth.io/docs/get-started/core-concepts/applications), use `retrieveApplication()`.
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
response = client.retrieve_application(
|
124
|
+
'd564255e-f767-466b-860d-6dcb63afe4cc'
|
125
|
+
)
|
126
|
+
|
127
|
+
handle_response(response)
|
128
|
+
```
|
129
|
+
|
130
|
+
[Check the API docs for this endpoint](https://fusionauth.io/docs/apis/applications#retrieve-an-application)
|
131
|
+
|
132
|
+
### Delete an Application
|
133
|
+
|
134
|
+
To delete an [Application](https://fusionauth.io/docs/get-started/core-concepts/applications), use `deleteApplication()`.
|
135
|
+
|
136
|
+
```ruby
|
137
|
+
response = client.delete_application(
|
138
|
+
'd564255e-f767-466b-860d-6dcb63afe4cc'
|
139
|
+
)
|
140
|
+
|
141
|
+
handle_response(response)
|
142
|
+
# Note that response.success_response will be empty
|
143
|
+
```
|
144
|
+
|
145
|
+
[Check the API docs for this endpoint](https://fusionauth.io/docs/apis/applications#delete-an-application)
|
146
|
+
|
147
|
+
### Lock a User
|
148
|
+
|
149
|
+
To [prevent a User from logging in](https://fusionauth.io/docs/get-started/core-concepts/users), use `deactivateUser()`.
|
150
|
+
|
151
|
+
```ruby
|
152
|
+
response = client.deactivate_user(
|
153
|
+
'fa0bc822-793e-45ee-a7f4-04bfb6a28199',
|
154
|
+
)
|
155
|
+
|
156
|
+
handle_response(response)
|
157
|
+
```
|
158
|
+
|
159
|
+
[Check the API docs for this endpoint](https://fusionauth.io/docs/apis/users#delete-a-user)
|
160
|
+
|
161
|
+
### Registering a User
|
162
|
+
|
163
|
+
To [register a User in an Application](https://fusionauth.io/docs/get-started/core-concepts/users#registrations), use `register()`.
|
164
|
+
|
165
|
+
The code below also adds a `customer` role and a custom `appBackgroundColor` property to the User Registration.
|
166
|
+
|
167
|
+
```ruby
|
168
|
+
response = client.register(
|
169
|
+
'fa0bc822-793e-45ee-a7f4-04bfb6a28199',
|
170
|
+
{
|
171
|
+
:registration => {
|
172
|
+
:applicationId => 'd564255e-f767-466b-860d-6dcb63afe4cc',
|
173
|
+
:roles => [
|
174
|
+
'customer',
|
175
|
+
],
|
176
|
+
:data => {
|
177
|
+
:appBackgroundColor => '#096324',
|
178
|
+
},
|
179
|
+
},
|
180
|
+
}
|
181
|
+
)
|
182
|
+
|
183
|
+
handle_response(response)
|
184
|
+
```
|
185
|
+
|
186
|
+
[Check the API docs for this endpoint](https://fusionauth.io/docs/apis/registrations#create-a-user-registration-for-an-existing-user)
|
187
|
+
|
188
|
+
# Documentation
|
189
|
+
|
190
|
+
Documentation can be found at
|
191
|
+
[doc](https://github.com/FusionAuth/fusionauth-ruby-client/tree/master/doc).
|
192
|
+
|
193
|
+
<!--
|
194
|
+
end::forDocSite[]
|
195
|
+
-->
|
196
|
+
|
197
|
+
## Questions and support
|
198
|
+
|
199
|
+
|
200
|
+
If you find any bugs in this library, [please open an issue](https://github.com/FusionAuth/fusionauth-ruby-client/issues). Note that changes to the `FusionAuthClient` class have to be done on the [FusionAuth Client Builder repository](https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/ruby.client.ftl), which is responsible for generating that file.
|
201
|
+
|
202
|
+
But if you have a question or support issue, we'd love to hear from you.
|
203
|
+
|
204
|
+
If you have a paid plan with support included, please [open a ticket in your account portal](https://account.fusionauth.io/account/support/). Learn more about [paid plan here](https://fusionauth.io/pricing).
|
205
|
+
|
206
|
+
Otherwise, please [post your question in the community forum](https://fusionauth.io/community/forum/).
|
207
|
+
|
208
|
+
## Contributing
|
209
|
+
|
210
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/FusionAuth/fusionauth-ruby-client.
|
211
|
+
|
212
|
+
Note: if you want to change the `FusionAuthClient` class, you have to do it on the [FusionAuth Client Builder repository](https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/ruby.client.ftl), which is responsible for generating all client libraries we support.
|
213
|
+
|
214
|
+
## License
|
215
|
+
|
216
|
+
This code is available as open source under the terms of the [Apache v2.0 License](https://opensource.org/blog/license/apache-2-0).
|
217
|
+
|
218
|
+
|
219
|
+
## Upgrade Policy
|
220
|
+
|
221
|
+
This library is built automatically to keep track of the FusionAuth API, and may also receive updates with bug fixes, security patches, tests, code samples, or documentation changes.
|
222
|
+
|
223
|
+
These releases may also update dependencies, language engines, and operating systems, as we\'ll follow the deprecation and sunsetting policies of the underlying technologies that it uses.
|
224
|
+
|
225
|
+
This means that after a dependency (e.g. language, framework, or operating system) is deprecated by its maintainer, this library will also be deprecated by us, and will eventually be updated to use a newer version.
|
data/build.savant
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c) 2018-
|
2
|
+
* Copyright (c) 2018-2024, FusionAuth, All Rights Reserved
|
3
3
|
*
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
* you may not use this file except in compliance with the License.
|
@@ -15,7 +15,7 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
pubVersion = ""
|
18
|
-
project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.
|
18
|
+
project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.51.0", licenses: ["ApacheV2_0"]) {
|
19
19
|
workflow {
|
20
20
|
fetch {
|
21
21
|
cache()
|
@@ -39,7 +39,7 @@ project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.49.1
|
|
39
39
|
}
|
40
40
|
|
41
41
|
// Plugins
|
42
|
-
file = loadPlugin(id: "org.savantbuild.plugin:file:2.0.0-RC.
|
42
|
+
file = loadPlugin(id: "org.savantbuild.plugin:file:2.0.0-RC.7")
|
43
43
|
release = loadPlugin(id: "org.savantbuild.plugin:release-git:2.0.0-RC.6")
|
44
44
|
|
45
45
|
target(name: "clean", description: "Cleans build directory") {
|