Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify subscribers when their authorization subjects are about to expire #964

Closed
yufei-cai opened this issue Feb 10, 2021 · 0 comments · Fixed by #994
Closed

Notify subscribers when their authorization subjects are about to expire #964

yufei-cai opened this issue Feb 10, 2021 · 0 comments · Fixed by #994
Milestone

Comments

@yufei-cai
Copy link
Contributor

yufei-cai commented Feb 10, 2021

#890 and #926 added temporary subjects in policies based on expiring JSON web tokens. For the subscribers using such subjects, it is convenient to get an announcement shortly before subject expiration so that they can renew their subjects with a fresh JSON web token.

  • Add a new signal type "Announcement"
  • Add to policy expiry a configurable duration for announcements before expiration
  • Publish announcements when subjects are about to expire
@thjaeckle thjaeckle added this to the 2.0.0 milestone Feb 22, 2021
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…d serialization.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…ionExtractorTest.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…ons.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…cations.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Changes:
	modified:   model/base/src/test/java/org/eclipse/ditto/model/base/headers/DittoDurationTest.java
	modified:   model/base/src/test/java/org/eclipse/ditto/model/base/headers/DittoDurationValueValidatorTest.java
	modified:   model/base/src/test/java/org/eclipse/ditto/model/base/headers/TimeoutValueValidatorTest.java

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…ateTokenIntegration.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
… connectivity.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…PoliciesRootActorTest.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…p DittoDuration public.

This partially reverts commit 7c86a72.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…ctExpiryNotification to SubjectDeletionAnnouncement.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
* moved now public DittoDuration from "headers" to "common" package
* made `subjectAnnouncement` in `Subject` nullable
* removed `emty()` `SubjectAnnouncement` specifics
* renamed JSON field `announce` to noun `announcement`
* fixed OSGi imports/exports in new announcement poms
* moved JsonFieldDefinition to separate JsonFields subclasses in interfaces
* made `SubjectDeletionAnnoucement.subjectIds` a Set
* added some missing `@since` javadoc tags

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…grationStrategy; add policyAnnouncementPub to PolicyPersistenceActor; fix DittoProtocolAdapterTest.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…ctors using annoucements alive:

* created a new MongoReadJournal functionality which finds out persistence IDs based on a provided journal "tag"
* pass through "journal-tags" as internal DittoHeaders in order to append them to the event journal persistence
* consequently use AbstractMongoEventAdapter as base for all EventAdapters and consolidated duplicated functionality
* fixed some generics magic
* provide "performToJournalMigration" and "performFromJournalMigration" as common way for EventAdapters to migrate data to/from persistence
* introduced "always-alive" tag and don't stop persistenceActors which get journal entries with this tag
* apply for PolicyCommmandStrategies that "always-alive" tag is set one SubjectAnnoucements are used

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…connectActor" for connectivity to "PersistencePingActor"

* moved to "ditto-services-utils-persistentactors" module
* re-use in both connectivity + policies in order to ping/wake up certain actors after cold start of the cluster (and also to keep alive)
* added PingCommand and PingCommandResponse message which can be sent to sharded actors in the cluster
* on cleanup of persistenceActors, always keep 1 last journal entry (which may be tagged by e.g. "always-alive") in order to find out which actors to ping
* don't stop PersistenceActors which are marked as "alwaysAlive" (e.g. via the journal tag) on activity check

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…TP requests for the policy action activateTokenIntegration; improve openapi and javadoc.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…istenceActor in order to get a journal entry with the "always-alive" journal tag for all connections which should be "open"

* produce this EmptyEvent when a ConnectionPersistenceActor was pinged with "empty" tag - this provides a migration path in order to only restore connections with target state "open" in the future

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…global event registry tests

* there the import to EmptyEvent was added for things;policies;connectivity

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
… connectivity.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…TokenIntegration` POST endpoint to be wrapped in an "annoucement" JsonObject

* fixed swagger documentation which had some dead references

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…tion notification when available, build a new correlation-id if not

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…returned when top-level policy actions could not be applied

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…k; decide "always-alive" flag and journal tag at the same time; remove "always-alive" tag setting from command strategies; test policy journal tags.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
… way to specify an optional list of placeholder prefixes which are not allowed to be left unresolved

* handle resulting UnresolvedPlaceholderException in routes by creating a PolicyActionFailedException

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…cePingActor.

Add the compound index on _tg, pid so that PersistencePingActor
need not sort all results.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…empty event for open connections on ping with empty journal tag.

Empty event should be persisted regardless of the "alwaysAlive" flag
because the "alwaysAlive" flag is set at the end of recovery to
"isDesiredStateOpen()".

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…l and the specifically added "subjectDeletion" announcement

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
… modification.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…mple to sitemap

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai pushed a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…ect deletion announcements

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
yufei-cai added a commit to bosch-io/ditto that referenced this issue Mar 4, 2021
…sistence callbacks; fix persistence actor test config.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants