fog-openstack 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/fog/openstack/identity/v3/models/application_credential.rb +43 -0
- data/lib/fog/openstack/identity/v3/models/application_credentials.rb +32 -0
- data/lib/fog/openstack/identity/v3/models/user.rb +5 -0
- data/lib/fog/openstack/identity/v3/requests/create_application_credentials.rb +25 -0
- data/lib/fog/openstack/identity/v3/requests/delete_application_credentials.rb +24 -0
- data/lib/fog/openstack/identity/v3/requests/get_application_credentials.rb +24 -0
- data/lib/fog/openstack/identity/v3/requests/list_application_credentials.rb +23 -0
- data/lib/fog/openstack/identity/v3.rb +7 -1
- data/lib/fog/openstack/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ec4a88f44d8f16a049716fa0d49659759a19845d5e3bc6faf28782f82943b39
|
4
|
+
data.tar.gz: e15cd2db5aa37baad7effc046137f8de088bce7eddb8fc69255431e51d483a01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fca48675057519c7b76a213a2803d2528ec9ac6828e1f56bca7b0c1bec379c541d40d840a7046ff969edb3ca09c349911cf05d2386b81ca518573e5feb090c8c
|
7
|
+
data.tar.gz: 4c3246a07bdbad1d1f1530481a8752bd88ffbc8724275e374a4ad6f5f11b8dc3e9b670a2d2405c21866dba1d25dc991726bee8b8a82b4003136dbd6ab8b95b32
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
+
# 1.1.5 2025/03/18
|
2
|
+
|
3
|
+
* add initial support for application credentials
|
4
|
+
|
1
5
|
# 1.1.4 2025/02/05
|
2
6
|
|
3
7
|
* fix DSL REST API v2 docs
|
4
8
|
* update to latest fog/.github
|
5
|
-
|
9
|
+
* fix namespace for OpenStack Orchestration utils
|
6
10
|
|
7
11
|
# 1.1.3 2024/06/12
|
8
12
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'fog/openstack/models/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module OpenStack
|
5
|
+
class Identity
|
6
|
+
class V3
|
7
|
+
class ApplicationCredential < Fog::OpenStack::Model
|
8
|
+
identity :id
|
9
|
+
|
10
|
+
attribute :description
|
11
|
+
attribute :name
|
12
|
+
attribute :roles
|
13
|
+
attribute :expires_at
|
14
|
+
attribute :user_id
|
15
|
+
attribute :secret
|
16
|
+
|
17
|
+
class << self
|
18
|
+
attr_accessor :cache
|
19
|
+
end
|
20
|
+
|
21
|
+
@cache = {}
|
22
|
+
|
23
|
+
def to_s
|
24
|
+
id.to_s
|
25
|
+
end
|
26
|
+
|
27
|
+
def destroy
|
28
|
+
requires :id
|
29
|
+
service.delete_application_credentials(id, user_id)
|
30
|
+
true
|
31
|
+
end
|
32
|
+
|
33
|
+
def create
|
34
|
+
merge_attributes(
|
35
|
+
service.create_application_credentials(attributes).body['application_credential']
|
36
|
+
)
|
37
|
+
self
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'fog/openstack/models/collection'
|
2
|
+
require 'fog/openstack/identity/v3/models/os_credential'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module OpenStack
|
6
|
+
class Identity
|
7
|
+
class V3
|
8
|
+
class ApplicationCredentials < Fog::OpenStack::Collection
|
9
|
+
model Fog::OpenStack::Identity::V3::ApplicationCredential
|
10
|
+
|
11
|
+
def all(options = {})
|
12
|
+
load_response(service.list_application_credentials(options), 'application_credentials')
|
13
|
+
end
|
14
|
+
|
15
|
+
def find_by_id(id, user_id)
|
16
|
+
cached_credential = all(user_id).find { |application_credential| application_credential.id == id }
|
17
|
+
return cached_credential if cached_credential
|
18
|
+
credential_hash = service.get_application_credentials(id, user_id).body['application_credential']
|
19
|
+
Fog::OpenStack::Identity::V3::ApplicationCredential.new(
|
20
|
+
credential_hash.merge(:service => service)
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def destroy(id)
|
25
|
+
credential = find_by_id(id)
|
26
|
+
credential.destroy
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -30,6 +30,11 @@ module Fog
|
|
30
30
|
service.list_user_projects(id).body['projects']
|
31
31
|
end
|
32
32
|
|
33
|
+
def application_credentials
|
34
|
+
requires :id
|
35
|
+
service.list_application_credentials(id).body['application_credentials']
|
36
|
+
end
|
37
|
+
|
33
38
|
def roles
|
34
39
|
requires :id, :domain_id
|
35
40
|
service.list_domain_user_roles(domain_id, id).body['roles']
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Fog
|
2
|
+
module OpenStack
|
3
|
+
class Identity
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def create_application_credentials(credential = {})
|
7
|
+
user_id = credential.delete('user_id') || credential.delete(:user_id)
|
8
|
+
request(
|
9
|
+
:expects => [201],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "users/#{user_id}/application_credentials",
|
12
|
+
:body => Fog::JSON.encode(:application_credential => credential)
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class Mock
|
18
|
+
def create_application_credentials(credential = {})
|
19
|
+
raise Fog::Errors::MockNotImplemented
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module OpenStack
|
3
|
+
class Identity
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def delete_application_credentials(application_credential_id, user_id)
|
7
|
+
request(
|
8
|
+
:expects => [204],
|
9
|
+
:method => 'DELETE',
|
10
|
+
:path => "users/#{user_id}/application_credentials/#{application_credential_id}",
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
def delete_application_credentials(application_credential_id, user_id)
|
17
|
+
raise Fog::Errors::MockNotImplemented
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module OpenStack
|
3
|
+
class Identity
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def get_application_credentials(id, user_id)
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "users/#{user_id}/application_credentials/#{id}",
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
def get_application_credentials(id, user_id)
|
17
|
+
raise Fog::Errors::MockNotImplemented
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Fog
|
2
|
+
module OpenStack
|
3
|
+
class Identity
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def list_application_credentials(user_id)
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "users/#{user_id}/application_credentials",
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
def list_application_credentials(user_id)
|
17
|
+
raise Fog::Errors::MockNotImplemented
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -37,6 +37,8 @@ module Fog
|
|
37
37
|
collection :role_assignments
|
38
38
|
model :os_credential
|
39
39
|
collection :os_credentials
|
40
|
+
model :application_credential
|
41
|
+
collection :application_credentials
|
40
42
|
model :policy
|
41
43
|
collection :policies
|
42
44
|
|
@@ -111,12 +113,16 @@ module Fog
|
|
111
113
|
request :create_os_credential
|
112
114
|
request :update_os_credential
|
113
115
|
request :delete_os_credential
|
116
|
+
request :list_application_credentials
|
117
|
+
request :create_application_credentials
|
118
|
+
request :delete_application_credentials
|
119
|
+
request :get_application_credentials
|
114
120
|
request :list_policies
|
115
121
|
request :get_policy
|
116
122
|
request :create_policy
|
117
123
|
request :update_policy
|
118
124
|
request :delete_policy
|
119
|
-
|
125
|
+
|
120
126
|
class Mock
|
121
127
|
include Fog::OpenStack::Core
|
122
128
|
def initialize(options = {})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Darby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -588,6 +588,8 @@ files:
|
|
588
588
|
- lib/fog/openstack/identity/v2/requests/update_user.rb
|
589
589
|
- lib/fog/openstack/identity/v2/requests/validate_token.rb
|
590
590
|
- lib/fog/openstack/identity/v3.rb
|
591
|
+
- lib/fog/openstack/identity/v3/models/application_credential.rb
|
592
|
+
- lib/fog/openstack/identity/v3/models/application_credentials.rb
|
591
593
|
- lib/fog/openstack/identity/v3/models/domain.rb
|
592
594
|
- lib/fog/openstack/identity/v3/models/domains.rb
|
593
595
|
- lib/fog/openstack/identity/v3/models/endpoint.rb
|
@@ -617,6 +619,7 @@ files:
|
|
617
619
|
- lib/fog/openstack/identity/v3/requests/check_domain_user_role.rb
|
618
620
|
- lib/fog/openstack/identity/v3/requests/check_project_group_role.rb
|
619
621
|
- lib/fog/openstack/identity/v3/requests/check_project_user_role.rb
|
622
|
+
- lib/fog/openstack/identity/v3/requests/create_application_credentials.rb
|
620
623
|
- lib/fog/openstack/identity/v3/requests/create_domain.rb
|
621
624
|
- lib/fog/openstack/identity/v3/requests/create_endpoint.rb
|
622
625
|
- lib/fog/openstack/identity/v3/requests/create_group.rb
|
@@ -626,6 +629,7 @@ files:
|
|
626
629
|
- lib/fog/openstack/identity/v3/requests/create_role.rb
|
627
630
|
- lib/fog/openstack/identity/v3/requests/create_service.rb
|
628
631
|
- lib/fog/openstack/identity/v3/requests/create_user.rb
|
632
|
+
- lib/fog/openstack/identity/v3/requests/delete_application_credentials.rb
|
629
633
|
- lib/fog/openstack/identity/v3/requests/delete_domain.rb
|
630
634
|
- lib/fog/openstack/identity/v3/requests/delete_endpoint.rb
|
631
635
|
- lib/fog/openstack/identity/v3/requests/delete_group.rb
|
@@ -635,6 +639,7 @@ files:
|
|
635
639
|
- lib/fog/openstack/identity/v3/requests/delete_role.rb
|
636
640
|
- lib/fog/openstack/identity/v3/requests/delete_service.rb
|
637
641
|
- lib/fog/openstack/identity/v3/requests/delete_user.rb
|
642
|
+
- lib/fog/openstack/identity/v3/requests/get_application_credentials.rb
|
638
643
|
- lib/fog/openstack/identity/v3/requests/get_domain.rb
|
639
644
|
- lib/fog/openstack/identity/v3/requests/get_endpoint.rb
|
640
645
|
- lib/fog/openstack/identity/v3/requests/get_group.rb
|
@@ -649,6 +654,7 @@ files:
|
|
649
654
|
- lib/fog/openstack/identity/v3/requests/grant_project_group_role.rb
|
650
655
|
- lib/fog/openstack/identity/v3/requests/grant_project_user_role.rb
|
651
656
|
- lib/fog/openstack/identity/v3/requests/group_user_check.rb
|
657
|
+
- lib/fog/openstack/identity/v3/requests/list_application_credentials.rb
|
652
658
|
- lib/fog/openstack/identity/v3/requests/list_domain_group_roles.rb
|
653
659
|
- lib/fog/openstack/identity/v3/requests/list_domain_user_roles.rb
|
654
660
|
- lib/fog/openstack/identity/v3/requests/list_domains.rb
|