Skip to content

Commit

Permalink
Final merge of development into main before switching to main only de…
Browse files Browse the repository at this point in the history
…velopment

Signed-off-by: pfeairheller <[email protected]>
  • Loading branch information
pfeairheller committed Apr 6, 2024
2 parents a36a3b6 + 5f06007 commit 4895803
Show file tree
Hide file tree
Showing 22 changed files with 798 additions and 125 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/python-app-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10.4
- name: Set up Python 3.12.2
uses: actions/setup-python@v2
with:
python-version: 3.10.4
python-version: 3.12.2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -44,10 +44,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10.4
- name: Set up Python 3.12.2
uses: actions/setup-python@v2
with:
python-version: 3.10.4
python-version: 3.12.2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ All Agent db access is through the associated Agent.

### Setup

* Ensure [Python](https://www.python.org/downloads/) `version 3.10.4+` is installed
* Ensure [Python](https://www.python.org/downloads/) `version 3.12.14+` is installed
* Install [Keripy dependency](https://github.com/WebOfTrust/keripy#dependencies) (`libsodium 1.0.18+`)


Expand Down
2 changes: 1 addition & 1 deletion docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Setup
~~~~~

- Ensure `Python <https://www.python.org/downloads/>`__
``version 3.10.4+`` is installed
``version 3.12.1+`` is installed
- Install `Keripy
dependency <https://github.com/WebOfTrust/keripy#dependencies>`__
(``libsodium 1.0.18+``)
Expand Down
4 changes: 2 additions & 2 deletions images/keria.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Builder stage
FROM python:3.10.13-alpine3.18 as builder
FROM python:3.12-alpine3.19 as builder

# Install compilation dependencies
RUN apk --no-cache add \
Expand Down Expand Up @@ -29,7 +29,7 @@ RUN . "$HOME/.cargo/env" && \
pip install -r requirements.txt

# Runtime stage
FROM python:3.10.13-alpine3.18
FROM python:3.12-alpine3.19

# Install runtime dependencies
RUN apk --no-cache add \
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
"resolver",
# eg: 'keyword1', 'keyword2', 'keyword3',
],
python_requires='>=3.10.4',
python_requires='>=3.12.2',
install_requires=[
'hio>=0.6.9',
'keri>=1.1.6',
'hio>=0.6.12',
'keri>=1.2.0-dev0',
'mnemonic>=0.20',
'multicommand>=1.0.0',
'falcon>=3.1.0',
'falcon>=3.1.3',
'http_sfv>=0.9.8',
'dataclasses_json>=0.5.7',
'apispec>=6.3.0',
Expand Down
26 changes: 15 additions & 11 deletions src/keria/app/agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@
from dataclasses import asdict
from urllib.parse import urlparse, urljoin

from keri import kering
from keri.app.notifying import Notifier
from keri.app.storing import Mailboxer

import falcon
from falcon import media
from hio.base import doing
from hio.core import http, tcp
from hio.help import decking

from keri import kering
from keri import core
from keri.app.notifying import Notifier
from keri.app.storing import Mailboxer


from keri.app import configing, keeping, habbing, storing, signaling, oobiing, agenting, \
forwarding, querying, connecting, grouping
from keri.app.grouping import Counselor
Expand Down Expand Up @@ -149,7 +153,7 @@ def createHttpServer(port, app, keypath=None, certpath=None, cafilepath=None):
class Agency(doing.DoDoer):
"""
Agency
"""

def __init__(self, name, bran, base="", configFile=None, configDir=None, adb=None, temp=False):
Expand All @@ -173,7 +177,7 @@ def __init__(self, name, bran, base="", configFile=None, configDir=None, adb=Non
self.adb = adb if adb is not None else basing.AgencyBaser(name="TheAgency", base=base, reopen=True, temp=temp)
super(Agency, self).__init__(doers=[], always=True)

def create(self, caid):
def create(self, caid, salt=None):
ks = keeping.Keeper(name=caid,
base=self.base,
temp=self.temp,
Expand All @@ -196,7 +200,7 @@ def create(self, caid):
cf.put(data)

# Create the Hab for the Agent with only 2 AIDs
agentHby = habbing.Habery(name=caid, base=self.base, bran=self.bran, ks=ks, cf=cf, temp=self.temp)
agentHby = habbing.Habery(name=caid, base=self.base, bran=self.bran, ks=ks, cf=cf, temp=self.temp, salt=salt)
agentHab = agentHby.makeHab(f"agent-{caid}", ns="agent", transferable=True, delpre=caid)
agentRgy = Regery(hby=agentHby, name=agentHab.name, base=self.base, temp=self.temp)

Expand Down Expand Up @@ -287,7 +291,7 @@ def __init__(self, hby, rgy, agentHab, agency, caid, **opts):
self.agency = agency
self.caid = caid

self.swain = delegating.Sealer(hby=hby, proxy=agentHab)
self.swain = delegating.Anchorer(hby=hby, proxy=agentHab)
self.counselor = Counselor(hby=hby, swain=self.swain, proxy=agentHab)
self.org = connecting.Organizer(hby=hby)

Expand Down Expand Up @@ -814,7 +818,7 @@ def on_post(self, req, rep):
if "sig" not in body:
raise falcon.HTTPBadRequest(title="invalid inception",
description=f'required field "sig" missing from body')
siger = coring.Siger(qb64=body["sig"])
siger = core.Siger(qb64=body["sig"])

caid = icp.pre

Expand Down Expand Up @@ -972,12 +976,12 @@ def on_get(req, rep):
preb = pre.encode("utf-8")
events = []
for fn, dig in agent.hby.db.getFelItemPreIter(preb, fn=0):
dgkey = dbing.dgKey(preb, dig) # get message
if not (raw := agent.hby.db.getEvt(key=dgkey)):
if not (raw := agent.hby.db.cloneEvtMsg(pre=preb, fn=fn, dig=dig)):
raise falcon.HTTPInternalServerError(f"Missing event for dig={dig}.")

serder = serdering.SerderKERI(raw=bytes(raw))
events.append(serder.ked)
atc = raw[serder.size:]
events.append(dict(ked=serder.ked, atc=atc.decode("utf-8")))

rep.status = falcon.HTTP_200
rep.content_type = "application/json"
Expand Down
Loading

0 comments on commit 4895803

Please sign in to comment.