Skip to content

Commit

Permalink
Frealm rlink (#154)
Browse files Browse the repository at this point in the history
* adjustments to autobahn class renames
* federated realm and frealm link (experimental)
  • Loading branch information
oberstet authored May 30, 2022
1 parent 852680e commit 9f52bd6
Show file tree
Hide file tree
Showing 22 changed files with 713 additions and 15 deletions.
1 change: 1 addition & 0 deletions authentication/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ print_log:

test_all: trunc_log test_anonymous test_cookie test_cryptosign test_scram test_ticket test_tls test_wampcra ## Test all WAMP authentication methods
@clear
@crossbar version
@cat ./test.log

test_anonymous: ## Test WAMP-anonymous
Expand Down
2 changes: 1 addition & 1 deletion authentication/cryptosign/dynamic/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, config=None):

# load the client private key (raw format)
try:
self._key = cryptosign.SigningKey.from_raw_key(config.extra['key'])
self._key = cryptosign.CryptosignKey.from_file(config.extra['key'])
except Exception as e:
self.log.error(
"could not load client private key: {log_failure}", log_failure=e)
Expand Down
2 changes: 1 addition & 1 deletion authentication/cryptosign/function/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, config=None):

# load the client private key (raw format)
try:
self._key = cryptosign.SigningKey.from_raw_key(config.extra['key'])
self._key = cryptosign.CryptosignKey.from_file(config.extra['key'])
except Exception as e:
self.log.error(
"could not load client private key: {log_failure}", log_failure=e)
Expand Down
2 changes: 1 addition & 1 deletion authentication/cryptosign/static/client_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, config=None):

# load the client private key (raw format)
try:
self._key = cryptosign.SigningKey.from_raw_key(config.extra['key'])
self._key = cryptosign.CryptosignKey.from_file(config.extra['key'])
except Exception as e:
self.log.error(
"could not load client private key: {log_failure}", log_failure=e)
Expand Down
4 changes: 2 additions & 2 deletions authentication/cryptosign/static/client_ssh_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

from autobahn import util
from autobahn.twisted.wamp import ApplicationSession
from autobahn.twisted.cryptosign import SSHAgentSigningKey
from autobahn.twisted.cryptosign import SSHAgentCryptosignKey


class ClientSession(ApplicationSession):
Expand All @@ -49,7 +49,7 @@ def onConnect(self):
print('Using public key from {}'.format(self.config.extra['pubkey']))

# create a proxy signing key with the private key being held in SSH agent
self._key = yield SSHAgentSigningKey.new(self.config.extra['pubkey'])
self._key = yield SSHAgentCryptosignKey.new(self.config.extra['pubkey'])

print('Public key: {}'.format(self._key.public_key()))

Expand Down
2 changes: 1 addition & 1 deletion authentication/cryptosign/static/client_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, config=None):

# load the client private key (raw format)
try:
self._key = cryptosign.SigningKey.from_raw_key(config.extra['key'])
self._key = cryptosign.CryptosignKey.from_file(config.extra['key'])
except Exception as e:
self.log.error(
"could not load client private key: {log_failure}", log_failure=e)
Expand Down
2 changes: 1 addition & 1 deletion authentication/cryptosign/tls/client_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, config=None):

# load the client private key (raw format)
try:
self._key = cryptosign.SigningKey.from_raw_key(config.extra['key'])
self._key = cryptosign.CryptosignKey.from_file(config.extra['key'])
except Exception as e:
self.log.error(
"could not load client private key: {log_failure}", log_failure=e)
Expand Down
2 changes: 1 addition & 1 deletion authentication/cryptosign/tls/client_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, config=None):

# load the client private key (raw format)
try:
self._key = cryptosign.SigningKey.from_raw_key(config.extra['key'])
self._key = cryptosign.CryptosignKey.from_file(config.extra['key'])
except Exception as e:
self.log.error(
"could not load client private key: {log_failure}", log_failure=e)
Expand Down
2 changes: 1 addition & 1 deletion authentication/scram/static/client_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, config=None):

# load the client private key (raw format)
try:
self._key = cryptosign.SigningKey.from_raw_key(config.extra['key'])
self._key = cryptosign.CryptosignKey.from_file(config.extra['key'])
except Exception as e:
self.log.error(
"could not load client private key: {log_failure}", log_failure=e)
Expand Down
2 changes: 1 addition & 1 deletion authentication/test.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Mi 4. Mai 12:24:28 CEST 2022
Sa 14. Mai 11:33:35 CEST 2022

Crossbar.io WAMP Authentication Test Summary:
=============================================
Expand Down
2 changes: 1 addition & 1 deletion authentication/tls/static/client_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, config=None):

# load the client private key (raw format)
try:
self._key = cryptosign.SigningKey.from_raw_key(config.extra['key'])
self._key = cryptosign.CryptosignKey.from_file(config.extra['key'])
except Exception as e:
self.log.error(
"could not load client private key: {log_failure}", log_failure=e)
Expand Down
2 changes: 1 addition & 1 deletion exclude_subscribers/alice.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class Component(ApplicationSession):
"""
"""
key = cryptosign.SigningKey.from_raw_key('alice.priv')
key = cryptosign.CryptosignKey.from_file('alice.priv')

@inlineCallbacks
def onJoin(self, details):
Expand Down
2 changes: 1 addition & 1 deletion exclude_subscribers/bob.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class Component(ApplicationSession):
"""
"""
key = cryptosign.SigningKey.from_raw_key('bob.priv')
key = cryptosign.CryptosignKey.from_file('bob.priv')

@inlineCallbacks
def onJoin(self, details):
Expand Down
2 changes: 1 addition & 1 deletion exclude_subscribers/carol.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class Component(ApplicationSession):
"""
"""
key = cryptosign.SigningKey.from_raw_key('carol.priv')
key = cryptosign.CryptosignKey.from_file('carol.priv')

@inlineCallbacks
def onJoin(self, details):
Expand Down
2 changes: 1 addition & 1 deletion exclude_subscribers/erin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class Component(ApplicationSession):
"""
"""
key = cryptosign.SigningKey.from_raw_key('erin.priv')
key = cryptosign.CryptosignKey.from_file('erin.priv')

@inlineCallbacks
def onJoin(self, details):
Expand Down
128 changes: 128 additions & 0 deletions federated-realm/test1/.crossbar-node1/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"version": 2,
"controller": {
"id": "node1"
},
"workers": [
{
"id": "router1",
"type": "router",
"options": {
"pythonpath": [".."]
},
"realms": [
{
"name": "wamp-proto.eth",
"roles": [
{
"name": "anonymous",
"permissions": [
{
"uri": "public.",
"match": "prefix",
"allow": {
"call": true,
"register": false,
"publish": false,
"subscribe": true
},
"disclose": {
"caller": true,
"publisher": false
},
"cache": true
}
]
},
{
"name": "user",
"permissions": [
{
"uri": "user.",
"match": "prefix",
"allow": {
"call": true,
"register": true,
"publish": true,
"subscribe": true
},
"disclose": {
"caller": true,
"publisher": true
},
"cache": true
},
{
"uri": "",
"match": "prefix",
"allow": {
"call": true,
"register": false,
"publish": false,
"subscribe": true
},
"disclose": {
"caller": true,
"publisher": false
},
"cache": true
}
]
},
{
"name": "backend",
"permissions": [
{
"uri": "",
"match": "prefix",
"allow": {
"call": false,
"register": true,
"publish": true,
"subscribe": false
},
"disclose": {
"caller": false,
"publisher": false
},
"cache": true
}
]
}
]
}
],
"transports": [
{
"type": "websocket",
"serializers": ["cbor", "json"],
"endpoint": {
"type": "tcp",
"port": 8080
},
"auth": {
"cryptosign": {
"type": "dynamic",
"authenticator": "com.example.authenticate",
"authenticator-realm": "wamp-proto.eth"
}
}
}
],
"components": [
{
"type": "class",
"classname": "_authenticator.Authenticator",
"realm": "wamp-proto.eth",
"role": "backend"
},
{
"type": "class",
"classname": "_backend.Backend",
"realm": "wamp-proto.eth",
"role": "backend"
}
]
}
]
}
128 changes: 128 additions & 0 deletions federated-realm/test1/.crossbar-node2/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"version": 2,
"controller": {
"id": "node2"
},
"workers": [
{
"id": "router1",
"type": "router",
"options": {
"pythonpath": [".."]
},
"realms": [
{
"name": "wamp-proto.eth",
"roles": [
{
"name": "anonymous",
"permissions": [
{
"uri": "public.",
"match": "prefix",
"allow": {
"call": true,
"register": false,
"publish": false,
"subscribe": true
},
"disclose": {
"caller": true,
"publisher": false
},
"cache": true
}
]
},
{
"name": "user",
"permissions": [
{
"uri": "user.",
"match": "prefix",
"allow": {
"call": true,
"register": true,
"publish": true,
"subscribe": true
},
"disclose": {
"caller": true,
"publisher": true
},
"cache": true
},
{
"uri": "",
"match": "prefix",
"allow": {
"call": true,
"register": false,
"publish": false,
"subscribe": true
},
"disclose": {
"caller": true,
"publisher": false
},
"cache": true
}
]
},
{
"name": "backend",
"permissions": [
{
"uri": "",
"match": "prefix",
"allow": {
"call": false,
"register": true,
"publish": true,
"subscribe": false
},
"disclose": {
"caller": false,
"publisher": false
},
"cache": true
}
]
}
]
}
],
"transports": [
{
"type": "websocket",
"serializers": ["cbor", "json"],
"endpoint": {
"type": "tcp",
"port": 8081
},
"auth": {
"cryptosign": {
"type": "dynamic",
"authenticator": "com.example.authenticate",
"authenticator-realm": "wamp-proto.eth"
}
}
}
],
"components": [
{
"type": "class",
"classname": "_authenticator.Authenticator",
"realm": "wamp-proto.eth",
"role": "backend"
},
{
"type": "class",
"classname": "_backend.Backend",
"realm": "wamp-proto.eth",
"role": "backend"
}
]
}
]
}
Loading

0 comments on commit 9f52bd6

Please sign in to comment.