Skip to content

Commit

Permalink
Merge pull request #6 from OneIdentity/feature/ktg/update_sps74
Browse files Browse the repository at this point in the history
Custom auth provider
  • Loading branch information
gyorgykt committed Mar 21, 2024
2 parents d0a21fb + 23c9612 commit cedeed8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 One Identity
Copyright (c) 2024 One Identity

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: SPS_AA_SRA_initiated
description: SPP-SPS join plugin for Safeguard Remote Access
version: 1.0.0
version: 1.1.0
type: aa
api: 1.6
api: 1.7.0
entry_point: main.py
author_name: One Identity Safeguard Remote Access
author_email: [email protected]
scb_max_version: 6.13.0~
scb_max_version: 8.0.0~
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[packages]
requests_toolbelt = "*"
yarl = "*"

[dev-packages]
oneidentity-safeguard-sessions-plugin-sdk = "*"

[requires]
python_version = "3.6"

python_version = "3.10"

2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env pluginwrapper3
#
# Copyright (c) 2019 One Identity
# Copyright (c) 2024 One Identity
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
Expand Down
7 changes: 6 additions & 1 deletion plugin/plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env pluginwrapper3
#
# Copyright (c) 2013-2021 Balabit
# Copyright (c) 2024 One Identity
# All Rights Reserved.
#

Expand Down Expand Up @@ -46,13 +46,17 @@ def original_username(self):
@cookie_property
def spp_username(self):
(username, domain) = split_username(self.username)
if self.spp_auth_provider.lower() == 'starling':
return self.username

return username

@cookie_property
def spp_auth_provider(self):
provider = self.plugin_configuration.get(PLUGIN_SECTION, 'spp_auth_provider')
if provider:
return provider

(username, domain) = split_username(self.username)
return domain if domain else 'Local'

Expand Down Expand Up @@ -98,6 +102,7 @@ def do_authenticate(self):

# SPS initiated code path should be extracted. pylint: disable=too-many-return-statements
def do_authorize(self):
self.session_cookie.setdefault("SessionId", self.connection.session_id)
self.session_cookie["WorkflowStatus"] = "token-granted"
key_value_pairs = self.connection.key_value_pairs
if "token" not in key_value_pairs:
Expand Down
3 changes: 1 addition & 2 deletions plugin/vault.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2013-2021 Balabit
# Copyright (c) 2024 One Identity
# All Rights Reserved.
#

Expand All @@ -9,7 +9,6 @@

from requests_toolbelt.adapters.source import SourceAddressAdapter


class Vault:
def __init__(self, spp_ip, sps_ip):
self._session = requests.Session()
Expand Down

0 comments on commit cedeed8

Please sign in to comment.