Users

All Posts (8)

avatar

sandrolukaszczyk

Bug in get_active_repository_entries function of python API-Manager

avatar
avatar
avatar
avatar
avatar

Hello,

The only thing I could think of is to be sure that you have switch to that repository before trying to get the tree structure.

Are you using the DVLS Python SDK or you have made your own script?

As Maurice has mentioned few months ago in this thread, we are not improving anymore the Python SDK anymore. Instead, we are working on a PowerShell module you will find on this Git repository. Let me know if you have any questions about this module.

https://github.com/Devolutions/devolutions-server

Best regards,

Hi Erica,

so do i understand you right that the bug in the python sdk won't be fixed at all and the Python SDK is completely unsupported now?

On the other side, the Powershell module seems like a very early pre-Alpha state, right? Without any documentation? Or did i maybe only overlooked the docs?

So what's the roadmap for the Powershell API? When will be there a state that can be declared stable for productive usage?

Bug in get_active_repository_entries function of python API-Manager

avatar
avatar
avatar
avatar
avatar

That can't be an option. On of the criteria why we bought the product because of its python sdk capability. Now after some work with it we must resumee, that the sdk is mostly buggy or main features are not implemented, so we are looking for a larger minor update. We have the year 2020 and a password server without a web api is not acceptable from our side.

Bug in get_active_repository_entries function of python API-Manager

avatar
avatar
avatar
avatar
avatar

Hello Erica, isn't the command line interface a local only tool? We use the SDK to manage the DPS remotely. CLI request would only work when they are done on the local DPS server or not?

Bug in get_active_repository_entries function of python API-Manager

avatar
avatar
avatar
avatar
avatar

So what types are working anyway? I used the create_... function, so it's not an update but an include. I mean the scenario is included in "SDK_tests.py".Or is there a alternative to credential to store normal non ssh or rdp passwords that works with the SDK? I like to store a database password and the database type is not available too.

I can understand that you can't tell an exact date when this will be fixed, but a rough estimate would be really nice. Are we talking about weeks or months? One of the main reasony our company decided to use DPS was that you offer a SDK and that would be a quite critical showstopper for a running project.

Bug in get_active_repository_entries function of python API-Manager

avatar
avatar
avatar
avatar
avatar

Hi Erica,

thank you for the update. The getter function for connections works now fine, but i found another problem.

The "create_credential_entry" function don't sets a password:

        self.DVLS.create_credential_entry(

            "Default",

            "Testentry",

            Group=folder,

            Password="Test123!!!",

            UserName="Testuser"

        )

And the Output when i get the entry with "get_credential_entries_by_name":

{
	'connectionSubType': 'Default',
	'connectionType': 26,
	'createdBy': 'XXX@XXX.systems',
	'createdDate': '2020-03-19T10:31:09',
	'data': {
		'credentialConnectionId': '',
		'passwordItem': {},
		'userName': 'Testuser'
	},
	'databaseId': '1A08F4AC-CD24-4EB6-BCAE-7D09097E8653',
	'description': '',
	'displayMode': 0,
	'domain': '',
	'group': 'Customers\\XXX',
	'groupName': '',
	'id': '60e001bd-40e6-4716-9e2d-ff45a8e5e82e',
	'imageBytes': '',
	'imageBytesUrl': 'ImageBytes.ashx?connectionType=26&connectionMasterSubType=&connectionSubType=Default&imageName=&imageSize=0',
	'imageName': '',
	'isViewPasswordEnabled': True,
	'keywords': '',
	'largeImageBytesUrl': 'ImageBytes.ashx?connectionType=26&connectionMasterSubType=&connectionSubType=Default&imageName=&imageSize=1',
	'modifiedDate': '',
	'name': 'Testentry',
	'originalGroup': 'Customers\\XXX\\Testentry',
	'originalName': 'Testentry',
	'partialConnections': [],
	'passwordTemplateId': '',
	'permissions': {
		'canAdd': True,
		'canCopyPassword': True,
		'canDelete': True,
		'canEdit': True,
		'canEditHandbook': True,
		'canEditSecurity': True,
		'canExecute': True,
		'canManageAttachments': True,
		'canView': True,
		'canViewAttachments': True,
		'canViewConnectionHistory': True,
		'canViewDeleted': True,
		'canViewHandbook': True,
		'canViewPassword': True,
		'canViewPasswordHistory': True,
		'canViewServerLogs': True
	},
	'resolvedPermissions': [{
			'resolvedStringValue': 'SecurityRoleOverride_Allowed'
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 2
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 4
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 3
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Disallowed',
			'right': 1
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 22
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Disallowed',
			'right': 7
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Disallowed',
			'right': 8
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Disallowed',
			'right': 9
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 11
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 12
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 15
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 16
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 10
		}, {
			'resolvedStringValue': 'SecurityRoleOverride_Allowed',
			'right': 13
		}
	],
	'repositoryId': '00000000-0000-0000-0000-000000000000',
	'resolvedTimeBasedUsageSettings': {
		'timeBasedUsageDays': 0,
		'timeBasedUsageHours': 0
	},
	'security': {
		'timeBasedUsageDays': 0,
		'timeBasedUsageHours': 0
	},
	'securityGroupId': '',
	'securityGroupName': '',
	'statusLockedBy': '',
	'statusMessage': '',
	'statusMessages': [{
			'defaultMessageLabelKey': ''
		}, {
			'connectionStatusBehavior': 1,
			'defaultMessageLabelKey': 'ThisEntryIsLockedAndCantBeOpened'
		}, {
			'connectionStatusBehavior': 2,
			'defaultMessageLabelKey': 'ThisEntryIsDsabledAndCantBeOpened'
		}, {
			'connectionStatusBehavior': 3,
			'defaultMessageLabelKey': 'ThisEntryHasAWarningMessage'
		}, {
			'connectionStatusBehavior': 4,
			'defaultMessageLabelKey': 'ThisEntryIsExpired'
		}
	],
	'templateGroup': [],
	'timeBasedUsageSettings': {
		'timeBasedUsageDays': 0,
		'timeBasedUsageHours': 0
	},
	'typeDescription': 'Username / Password',
	'typeId': 'CredentialDefaultDefault',
	'userName': 'Testuser'
}


Bug in get_active_repository_entries function of python API-Manager

avatar
avatar
avatar
avatar
avatar

Hi Erica,

i like to create a database connection, not the folder. Oh ok, i thaught it is supported because generated/enums/ConnectionType.py has an entry for Database. Would be nice to know if it is planned to implement this in the near future.

Do you approximate date when the SDK will be upgraded on github?

Bug in get_active_repository_entries function of python API-Manager

avatar
avatar
avatar
avatar
avatar

Hi Erica and thanks for the update.

I think i found another bug. When i try to create a connection of the type database:

self.DVLS.create_connection(

ConnectionType.Database,

...

throws the error:

File "./dps_connector.py", line 145, in <module>

connector.database("XXX", "administrator", "bockwurst", 'Customers\\'+group, "hana", "t01", None, securityGroup)

File "./dps_connector.py", line 111, in database

UserName=user

File "/home/XXX/a500112/workspace/XXX/Connectors/dps-sdk-python/dvlssdk/__init__.py", line 1221, in create_connection

entry = self._generate_connection_entry(entry, entry_type, type_id, name, options)

File "/home/XXX/a500112/workspace/XXX/Connectors/dps-sdk-python/dvlssdk/__init__.py", line 2153, in _generate_connection_entry

data_model = init_model('generated', entry_type + 'Entry')

File "/home/XXX/a500112/workspace/XXX/Connectors/dps-sdk-python/dvlssdk/InitHelpers.py", line 34, in init_model

return init_type(folder + '.models', name)()

File "/home/XXX/a500112/workspace/XXX/Connectors/dps-sdk-python/dvlssdk/InitHelpers.py", line 28, in init_type

imported_module = importlib.import_module('.' + name, 'dvlssdk.' + folder)

File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>", line 994, in _gcd_import

File "<frozen importlib._bootstrap>", line 971, in _find_and_load

File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'dvlssdk.generated.models.DatabaseEntry'

I've checked it, and there really is no DatabaseEntry file in the modules folder.

Could you confirm that this will be fixed in the upcoming SDK update too?

Bug in get_active_repository_entries function of python API-Manager

avatar
avatar
avatar
avatar
avatar

Hi, i'm testing the Python SDK and it works quite good until the "get_connections_by_name" function. It throws me an error.

My last function call:

connection = self.DVLS.get_connections_by_name("Customers")

My Output:

[INFO] [DvlsSDK.login] - Successful for a500112

[ERROR] [DvlsSDK.get_security_group_id] - Security Group 'Testgroup' not found, aborting get security group id

[INFO] [DvlsSDK.create_connection] - Successful for Testgroup

HERE <Response [405]>

[ERROR] [DvlsSDK.get_repository_entries_list] - Failed

[ERROR] [DvlsSDK.get_connections_by_name] - Failed for Customers

The first 3 logentries are for some connection creatsions, the point of "HERE" is from the "get_active_repository_entries" function where i included a print for debugging:

def get_active_repository_entries(self, verbose_override=None):

web_request = self._do_api_post_json(self.url_resolver.entries_tree_url(), "")

print("HERE", web_request)

return SDKResult(web_request.json())

It's strange that a get function uses a post-request. All other "get_" function uses "_do_api_get". I tested it with changing the call to "_do_api_get" and it responded with a 200, but then there were errors in the further code.

The Server Version is 2019.2.12.0

1 - 8 of 8 items