Skip to content

Commit

Permalink
chore: misc cleanups (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
aludwiko authored Dec 16, 2024
1 parent 98e726e commit 8c5ac18
Show file tree
Hide file tree
Showing 21 changed files with 50 additions and 1,260 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import kalix.{ Annotations => KalixAnnotations }
import org.slf4j.LoggerFactory

import java.util.Collections
import scala.PartialFunction.condOpt

/**
* INTERNAL API
Expand Down Expand Up @@ -121,23 +120,6 @@ private[impl] object AclDescriptorFactory {
fd.toProto
}

def serviceLevelAclAnnotation(component: Class[_], default: Option[ProtoAcl] = None): Option[kalix.ServiceOptions] = {

val javaAclAnnotation = component.getAnnotation(classOf[Acl])

def buildServiceOpts(acl: ProtoAcl): kalix.ServiceOptions = {
kalix.ServiceOptions
.newBuilder()
.setAcl(acl)
.build()
}

condOpt(javaAclAnnotation, default) {
case (aclAnnotation, _) if aclAnnotation != null => buildServiceOpts(deriveProtoAnnotation(aclAnnotation))
case (null, Some(acl)) => buildServiceOpts(acl)
}
}

def methodLevelAclAnnotation(method: Method): Option[kalix.MethodOptions] = {

val javaAclAnnotation = method.getAnnotation(classOf[Acl])
Expand Down
Loading

0 comments on commit 8c5ac18

Please sign in to comment.