55 "errors"
66
77 "github.com/sirupsen/logrus"
8+ "go.temporal.io/sdk/temporal"
89)
910
1011// RegisterActivities registers provider-specific activities with the Temporal worker
@@ -22,6 +23,26 @@ func NewProviderActivities(provider ProviderImpl) *ProviderActivities {
2223 }
2324}
2425
26+ func (a * ProviderActivities ) AuthorizeRole (
27+ ctx context.Context ,
28+ req * AuthorizeRoleRequest ,
29+ ) (* AuthorizeRoleResponse , error ) {
30+
31+ logrus .Infoln ("Starting AuthorizeRole activity" )
32+ return handleNotImplementedError (a .provider .AuthorizeRole (ctx , req ))
33+
34+ }
35+
36+ func (a * ProviderActivities ) RevokeRole (
37+ ctx context.Context ,
38+ req * RevokeRoleRequest ,
39+ ) (* RevokeRoleResponse , error ) {
40+
41+ logrus .Infoln ("Starting RevokeRole activity" )
42+ return handleNotImplementedError (a .provider .RevokeRole (ctx , req ))
43+
44+ }
45+
2546func (a * ProviderActivities ) SynchronizeIdentities (
2647 ctx context.Context ,
2748 req SynchronizeUsersRequest ,
@@ -97,10 +118,11 @@ func (a *ProviderActivities) SynchronizeRoles(
97118func handleNotImplementedError [T any ](res T , err error ) (T , error ) {
98119 if err != nil {
99120 if errors .Is (err , ErrNotImplemented ) {
100- // Ignore not implemented errors. This will
101- // just complete the activity as successful without doing anything.
102- logrus .WithError (err ).Infoln ("Activity not implemented for this provider, skipping" )
103- return res , nil
121+ return res , temporal .NewNonRetryableApplicationError (
122+ "activity not implemented for this provider" ,
123+ "NotImplementedError" ,
124+ err ,
125+ )
104126 }
105127 }
106128 return res , err
0 commit comments