├── .detekt.yml ├── .editorconfig ├── .github ├── dependabot.yml └── workflows │ ├── build.yml │ ├── bump_dependencies.yml │ ├── gradle-wrapper-validation.yml │ ├── pr.yml │ ├── release.yml │ └── release_info.sh ├── .gitignore ├── .idea ├── README.md ├── compiler.xml ├── copyright │ ├── ALS2.xml │ └── profiles_settings.xml ├── google-java-format.xml ├── gradle.xml └── vcs.xml ├── .mergify.yml ├── AUTHORS ├── CODEOWNERS ├── LICENSE.txt ├── OWNERS.md ├── README.md ├── autobump.sh ├── build.gradle ├── gradle.properties ├── gradle ├── kotlin-test.gradle ├── kotlin.gradle ├── lombok.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── kork-actuator ├── kork-actuator.gradle └── src │ └── main │ ├── java │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── actuator │ │ ├── ActuatorEndpointsConfiguration.java │ │ ├── ResolvedEnvEndpointAutoConfiguration.java │ │ └── endpoint │ │ ├── ResolvedEnvironmentConfigurationProperties.java │ │ └── ResolvedEnvironmentEndpoint.java │ └── resources │ └── META-INF │ ├── spring.factories │ └── spring │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports ├── kork-annotations ├── kork-annotations.gradle └── src │ └── main │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── annotations │ ├── Alpha.java │ ├── Beta.java │ ├── DeprecationInfo.java │ ├── FieldsAreNonnullByDefault.java │ ├── FieldsAreNullableByDefault.java │ ├── Metered.java │ ├── MethodsReturnNonnullByDefault.java │ ├── MethodsReturnNullableByDefault.java │ ├── NonnullByDefault.java │ ├── NullableByDefault.java │ └── VisibleForTesting.java ├── kork-api ├── kork-api.gradle └── src │ └── main │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── api │ ├── exceptions │ ├── AccessDeniedDetails.java │ ├── ExceptionDetails.java │ ├── ExceptionMessage.java │ ├── ExceptionSummary.java │ └── package-info.java │ ├── expressions │ ├── ExpressionFunctionProvider.java │ └── package-info.java │ └── plugins │ └── remote │ └── RemoteExtensionConfig.java ├── kork-artifacts ├── kork-artifacts.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── artifacts │ │ ├── ArtifactTypes.java │ │ ├── README.md │ │ ├── artifactstore │ │ ├── ArtifactDecorator.java │ │ ├── ArtifactDeserializer.java │ │ ├── ArtifactReferenceURI.java │ │ ├── ArtifactStore.java │ │ ├── ArtifactStoreConfiguration.java │ │ ├── ArtifactStoreConfigurationProperties.java │ │ ├── ArtifactStoreGetter.java │ │ ├── ArtifactStoreStorer.java │ │ ├── ArtifactStoreURIBuilder.java │ │ ├── ArtifactStoreURISHA256Builder.java │ │ ├── EmbeddedArtifactSerializer.java │ │ ├── NoopArtifactStoreGetter.java │ │ ├── NoopArtifactStoreStorer.java │ │ ├── exceptions │ │ │ └── ArtifactStoreIOException.java │ │ └── s3 │ │ │ ├── S3ArtifactStore.java │ │ │ ├── S3ArtifactStoreConfiguration.java │ │ │ ├── S3ArtifactStoreGetter.java │ │ │ └── S3ArtifactStoreStorer.java │ │ ├── model │ │ ├── Artifact.java │ │ └── ExpectedArtifact.java │ │ └── parsing │ │ ├── ArtifactExtractor.java │ │ ├── DefaultJinjavaFactory.java │ │ ├── JinjaArtifactExtractor.java │ │ └── JinjavaFactory.java │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── artifacts │ ├── artifactstore │ ├── ArtifactDeserializerTest.java │ ├── ArtifactReferenceURITest.java │ ├── ArtifactStoreConfigurationTest.java │ ├── ArtifactStoreTest.java │ ├── ArtifactStoreURISHA256BuilderTest.java │ ├── EmbeddedArtifactSerializerTest.java │ ├── exceptions │ │ └── ArtifactStoreIOExceptionTest.java │ └── s3 │ │ ├── S3ArtifactStoreConfigurationTest.java │ │ ├── S3ArtifactStoreGetterTest.java │ │ └── S3ArtifactStoreStorerTest.java │ └── model │ ├── ArtifactTest.java │ └── ExpectedArtifactTest.java ├── kork-aws ├── kork-aws.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ └── aws │ │ │ ├── ARN.java │ │ │ ├── AwsComponents.java │ │ │ ├── AwsMetricsSupport.java │ │ │ ├── InstrumentedBackoffStrategy.java │ │ │ ├── InstrumentedRetryCondition.java │ │ │ └── bastion │ │ │ ├── BastionConfig.java │ │ │ ├── BastionCredentialsProvider.java │ │ │ ├── BastionProperties.java │ │ │ └── RemoteCredentialsSupport.java │ └── resources │ │ └── META-INF │ │ ├── spring.factories │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── aws │ └── ARNTest.java ├── kork-bom └── kork-bom.gradle ├── kork-cloud-config-server ├── kork-cloud-config-server.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ └── configserver │ │ │ ├── CloudConfigApplicationListener.java │ │ │ ├── CloudConfigAwarePropertySource.java │ │ │ ├── CloudConfigResourceService.java │ │ │ ├── ConfigFileLoadingException.java │ │ │ ├── ConfigFileService.java │ │ │ ├── ConfigFileUtils.java │ │ │ ├── ConfigServerBootstrap.java │ │ │ └── autoconfig │ │ │ ├── CloudConfigAutoConfiguration.java │ │ │ ├── RemoteConfigSourceConfigured.java │ │ │ ├── SpringCloudAwsConfiguration.java │ │ │ └── SpringCloudAwsS3ResourceLoaderConfiguration.java │ └── resources │ │ ├── META-INF │ │ ├── spring.factories │ │ └── spring │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── spinnakerconfig.yml │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── configserver │ ├── CloudConfigResourceServiceTest.java │ ├── ConfigFileServiceTest.java │ ├── ConfigServerBootstrapTest.java │ └── ConfigServerTestApplication.java ├── kork-config ├── kork-config.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── boot │ │ └── DefaultPropertiesBuilder.java │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── boot │ ├── DefaultPropertiesBuilderTest.java │ └── TestApplication.java ├── kork-core-tck ├── kork-core-tck.gradle └── src │ └── main │ └── groovy │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── lock │ └── BaseLockManagerSpec.groovy ├── kork-core ├── README.md ├── kork-core.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ ├── PlatformComponents.java │ │ │ ├── common │ │ │ └── Header.java │ │ │ ├── discovery │ │ │ ├── DiscoveryAutoConfiguration.java │ │ │ ├── DiscoveryStatusChangeEvent.java │ │ │ ├── DiscoveryStatusListener.java │ │ │ ├── DiscoveryStatusPublisher.java │ │ │ ├── InstanceStatus.java │ │ │ ├── NoDiscoveryStatusPublisher.java │ │ │ └── RemoteStatusChangedEvent.java │ │ │ ├── dynamicconfig │ │ │ ├── DynamicConfigService.java │ │ │ ├── ScopedCriteria.java │ │ │ ├── SpringDynamicConfigService.java │ │ │ └── TransientConfigConfiguration.java │ │ │ ├── jackson │ │ │ ├── InvalidSubtypeConfigurationException.java │ │ │ ├── JsonTypeNameParser.java │ │ │ ├── NamedTypeParser.java │ │ │ └── ObjectMapperSubtypeConfigurer.java │ │ │ ├── lock │ │ │ ├── LockManager.java │ │ │ └── RefreshableLockManager.java │ │ │ ├── metrics │ │ │ ├── SpectatorConfiguration.java │ │ │ └── SpectatorGcLoggingConfiguration.java │ │ │ ├── resilience4j │ │ │ └── Resilience4jHelper.java │ │ │ ├── spring │ │ │ └── SpringBoot1CompatibilityApplicationListener.java │ │ │ ├── version │ │ │ ├── ServiceVersion.java │ │ │ ├── SpringPackageVersionResolver.java │ │ │ └── VersionResolver.java │ │ │ └── web │ │ │ └── exceptions │ │ │ └── DefaultThreadUncaughtExceptionHandler.java │ └── resources │ │ └── META-INF │ │ ├── spring.factories │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ └── test │ ├── groovy │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ ├── dynamicconfig │ │ └── SpringDynamicConfigServiceSpec.groovy │ │ └── version │ │ └── SpringPackageVersionResolverSpec.groovy │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ ├── jackson │ ├── NamedTypeParserTest.java │ └── ObjectMapperSubtypeConfigurerTest.java │ └── resilience4j │ └── Resilience4jHelperTest.java ├── kork-credentials-api ├── kork-credentials-api.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── credentials │ │ ├── CompositeCredentialsRepository.java │ │ ├── Credentials.java │ │ ├── CredentialsLifecycleHandler.java │ │ ├── CredentialsRepository.java │ │ ├── MapBackedCredentialsRepository.java │ │ ├── NoopCredentialsLifecycleHandler.java │ │ ├── definition │ │ ├── AbstractCredentialsLoader.java │ │ ├── BasicCredentialsLoader.java │ │ ├── CredentialsDefinition.java │ │ ├── CredentialsDefinitionSource.java │ │ ├── CredentialsLoader.java │ │ ├── CredentialsParser.java │ │ ├── CredentialsType.java │ │ └── package-info.java │ │ └── package-info.java │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── credentials │ ├── CompositeCredentialsRepositoryTest.java │ ├── MapBackedCredentialsRepositoryTest.java │ └── definition │ ├── BasicCredentialsLoaderTest.java │ ├── CredentialsDefinitionMixin.java │ ├── CredentialsTypeTest.java │ └── TestCredentialsDefinition.java ├── kork-credentials ├── kork-credentials.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── credentials │ │ │ ├── CredentialsTypeBaseConfiguration.java │ │ │ ├── CredentialsTypeProperties.java │ │ │ ├── jackson │ │ │ ├── Sensitive.java │ │ │ ├── SensitiveAutoConfiguration.java │ │ │ ├── SensitiveProperties.java │ │ │ └── SensitiveSerializer.java │ │ │ └── poller │ │ │ ├── Poller.java │ │ │ ├── PollerConfiguration.java │ │ │ └── PollerConfigurationProperties.java │ └── resources │ │ └── META-INF │ │ ├── spring.factories │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── credentials │ ├── CredentialsTypeBaseConfigurationTest.java │ └── jackson │ ├── SensitiveAccount.java │ └── SensitiveSerializerTest.java ├── kork-crypto ├── kork-crypto.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── crypto │ │ ├── CipherSuites.java │ │ ├── IdentityX509KeyManager.java │ │ ├── KeyFactories.java │ │ ├── NestedSecurityIOException.java │ │ ├── NestedSecurityRuntimeException.java │ │ ├── PEMIdentitySource.java │ │ ├── PasswordProtectedKeyStoreIdentitySource.java │ │ ├── PasswordProvider.java │ │ ├── RefreshableX509Identity.java │ │ ├── SecureRandomBuilder.java │ │ ├── StandardCrypto.java │ │ ├── StaticX509Identity.java │ │ ├── TrustStores.java │ │ ├── X509Identity.java │ │ ├── X509IdentitySource.java │ │ └── package-info.java │ ├── test │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── crypto │ │ ├── PEMIdentitySourceTest.java │ │ ├── PEMTrustStoreLoaderTest.java │ │ ├── PKCS12IdentitySourceTest.java │ │ └── RefreshableIdentityTest.java │ └── testFixtures │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── crypto │ └── test │ ├── CertificateIdentity.java │ └── TestCrypto.java ├── kork-eureka ├── README.md ├── kork-eureka.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ ├── archaius │ │ │ ├── ArchaiusAutoConfiguration.java │ │ │ └── SpringEnvironmentPolledConfigurationSource.java │ │ │ └── eureka │ │ │ ├── BootHealthCheckHandler.java │ │ │ ├── EurekaAutoConfiguration.java │ │ │ ├── EurekaConfigurationProperties.java │ │ │ ├── EurekaStatusListener.java │ │ │ ├── EurekaStatusSubscriber.java │ │ │ └── InstanceStatusUtil.java │ └── resources │ │ └── META-INF │ │ ├── spring.factories │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ └── test │ └── kotlin │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── EurekaSystemTest.kt ├── kork-exceptions ├── kork-exceptions.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ ├── core │ │ └── RetrySupport.java │ │ ├── exceptions │ │ ├── ConfigurationException.java │ │ ├── ConstraintViolationException.java │ │ ├── CredentialsException.java │ │ ├── HasAdditionalAttributes.java │ │ ├── IntegrationException.java │ │ ├── InvalidCredentialsTypeException.java │ │ ├── MissingCredentialsException.java │ │ ├── SpinnakerException.java │ │ ├── SystemException.java │ │ ├── UnknownCredentialsTypeException.java │ │ └── UserException.java │ │ └── web │ │ └── exceptions │ │ ├── InvalidRequestException.java │ │ ├── NotFoundException.java │ │ └── ValidationException.java │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── core │ └── RetrySupportTest.java ├── kork-expressions ├── kork-expressions.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ └── expressions │ │ │ ├── ArtifactUriToReferenceConverter.java │ │ │ ├── ExpressionEvaluationSummary.java │ │ │ ├── ExpressionTransform.java │ │ │ ├── ExpressionsSupport.java │ │ │ ├── NotEvaluableExpression.java │ │ │ ├── SpelHelperFunctionException.java │ │ │ ├── allowlist │ │ │ ├── AllowListTypeLocator.java │ │ │ ├── FilteredMethodResolver.java │ │ │ ├── FilteredPropertyAccessor.java │ │ │ ├── InstantiationTypeRestrictor.java │ │ │ ├── MapPropertyAccessor.java │ │ │ └── ReturnTypeRestrictor.java │ │ │ ├── config │ │ │ └── ExpressionProperties.java │ │ │ └── functions │ │ │ └── ArtifactStoreFunctions.java │ └── kotlin │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── expressions │ │ └── ExpressionFunctionProvider.kt │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── expressions │ ├── ExpressionTransformTest.java │ └── ExpressionsSupportTest.java ├── kork-jedis-test ├── kork-jedis-test.gradle └── src │ └── main │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── jedis │ └── EmbeddedRedis.java ├── kork-jedis ├── kork-jedis.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── jedis │ │ ├── JedisClientConfiguration.java │ │ ├── JedisClientDelegate.java │ │ ├── JedisClientDelegateFactory.java │ │ ├── JedisDriverProperties.java │ │ ├── JedisHealthIndicatorFactory.java │ │ ├── JedisPoolFactory.java │ │ ├── RedisClientConfiguration.java │ │ ├── RedisClientConnectionProperties.java │ │ ├── RedisClientDelegate.java │ │ ├── RedisClientDelegateFactory.java │ │ ├── RedisClientSelector.java │ │ ├── RedisScanResult.java │ │ ├── exception │ │ ├── ConflictingConfiguration.java │ │ ├── MissingRequiredConfiguration.java │ │ ├── RedisClientFactoryNotFound.java │ │ └── RedisClientNotFound.java │ │ ├── lock │ │ └── RedisLockManager.java │ │ └── telemetry │ │ ├── InstrumentedJedis.java │ │ ├── InstrumentedJedisException.java │ │ ├── InstrumentedJedisPool.java │ │ ├── InstrumentedPipeline.java │ │ └── TelemetryHelper.java │ └── test │ ├── groovy │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── jedis │ │ ├── RedisClientSelectorSpec.groovy │ │ └── locking │ │ └── RedisLockManagerSpec.groovy │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── jedis │ ├── RedisClientConnectionPropertiesTest.java │ └── telemetry │ └── InstrumentedJedisPoolTest.java ├── kork-moniker ├── kork-moniker.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ ├── moniker │ │ ├── Moniker.java │ │ ├── Namer.java │ │ └── frigga │ │ │ └── FriggaReflectiveNamer.java │ │ └── orchestration │ │ └── OperationDescription.java │ └── test │ └── groovy │ └── com │ └── netflix │ └── spinnaker │ └── moniker │ └── frigga │ └── FriggaReflectiveNamerSpec.groovy ├── kork-plugins-api ├── kork-plugins-api.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── plugins │ │ └── api │ │ ├── ExtensionConfiguration.java │ │ ├── PluginComponent.java │ │ ├── PluginConfiguration.java │ │ ├── PluginSdks.java │ │ ├── events │ │ ├── Async.java │ │ ├── SpinnakerApplicationEvent.java │ │ └── SpinnakerEventListener.java │ │ ├── httpclient │ │ ├── HttpClient.java │ │ ├── HttpClientConfig.java │ │ ├── HttpClientRegistry.java │ │ ├── Request.java │ │ └── Response.java │ │ ├── internal │ │ ├── ExtensionInvocationHandler.java │ │ ├── ExtensionPointMetadataProvider.java │ │ └── SpinnakerExtensionPoint.java │ │ ├── serde │ │ └── SerdeService.java │ │ ├── servicesdk │ │ ├── EmptyServiceSdk.java │ │ └── ServiceSdk.java │ │ └── yaml │ │ └── YamlResourceLoader.java │ └── test │ └── kotlin │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── plugins │ └── api │ └── internal │ └── ExtensionClassProviderTest.kt ├── kork-plugins-spring-api ├── kork-plugins-spring-api.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── plugins │ │ └── api │ │ └── spring │ │ ├── BeanPromoter.java │ │ ├── ExposeToApp.java │ │ ├── PrivilegedSpringPlugin.java │ │ ├── SpringLoader.java │ │ ├── SpringLoaderBeanPostProcessor.java │ │ ├── SpringLoaderCustomInit.java │ │ └── SpringLoaderPlugin.java │ └── test │ └── kotlin │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── plugins │ └── api │ └── spring │ ├── PrivilegedSpringPluginTest.kt │ ├── SpringLoaderBeanPostProcessorTest.kt │ ├── SpringLoaderPluginTest.kt │ ├── SpringLoaderTest.kt │ ├── TestPrivilegedSpringPlugin.kt │ └── TestSpringLoaderPlugin.kt ├── kork-plugins-tck ├── README.md ├── kork-plugins-tck.gradle └── src │ ├── main │ └── kotlin │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── plugins │ │ ├── internal │ │ ├── ClassDataProvider.kt │ │ ├── DefaultClassDataProvider.kt │ │ ├── PluginJar.kt │ │ └── PluginZip.kt │ │ ├── tck │ │ ├── PluginsTck.kt │ │ └── PluginsTckFixture.kt │ │ └── testplugin │ │ ├── GeneratedTestPlugin.kt │ │ ├── TestPluginBuilderSupport.kt │ │ ├── TestPluginGenerator.kt │ │ ├── api │ │ └── TestExtension.kt │ │ └── builders.kt │ └── test │ └── kotlin │ └── com │ └── spinnaker │ └── netflix │ └── kork │ └── plugins │ ├── TestPluginGeneratorTest.kt │ ├── internal │ └── PluginJarTest.kt │ ├── plugin.kt │ └── tck │ └── PluginsTckFixtureTest.kt ├── kork-plugins ├── README.md ├── V2-COMPATIBILITY.md ├── kork-plugins.gradle ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── netflix │ │ │ │ └── spinnaker │ │ │ │ └── config │ │ │ │ ├── Front50PluginsConfiguration.java │ │ │ │ ├── HttpClientSdkConfiguration.java │ │ │ │ ├── PluginsAutoConfiguration.java │ │ │ │ ├── PluginsConfigurationProperties.java │ │ │ │ ├── RemotePluginsConfiguration.java │ │ │ │ ├── SerdeSdkConfiguration.java │ │ │ │ └── YamlResourceLoaderSdkConfiguration.java │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── netflix │ │ │ │ └── spinnaker │ │ │ │ └── kork │ │ │ │ └── plugins │ │ │ │ ├── CanonicalPluginId.kt │ │ │ │ ├── ExtensionBeanDefinitionRegistryPostProcessor.kt │ │ │ │ ├── SpinnakerExtensionFactory.kt │ │ │ │ ├── SpinnakerPluginDescriptor.kt │ │ │ │ ├── SpinnakerPluginFactory.kt │ │ │ │ ├── SpinnakerPluginManager.kt │ │ │ │ ├── SpinnakerServiceVersionManager.kt │ │ │ │ ├── SpringPluginStatusProvider.kt │ │ │ │ ├── SpringStrictPluginLoaderStatusProvider.kt │ │ │ │ ├── VersionRequirementsParser.kt │ │ │ │ ├── actuator │ │ │ │ └── InstalledPluginsEndpoint.kt │ │ │ │ ├── bundle │ │ │ │ └── PluginBundleExtractor.kt │ │ │ │ ├── config │ │ │ │ ├── ConfigCoordinates.kt │ │ │ │ ├── ConfigFactory.kt │ │ │ │ ├── ConfigResolver.kt │ │ │ │ ├── Configurable.kt │ │ │ │ └── SpringEnvironmentConfigResolver.kt │ │ │ │ ├── dsl.kt │ │ │ │ ├── events │ │ │ │ ├── ExtensionCreated.kt │ │ │ │ ├── ExtensionLoaded.kt │ │ │ │ ├── PluginDownloaded.kt │ │ │ │ ├── RemotePluginCacheRefresh.kt │ │ │ │ └── RemotePluginConfigChanged.kt │ │ │ │ ├── finders │ │ │ │ ├── PluginRefPluginDescriptorFinder.kt │ │ │ │ ├── SpinnakerManifestPluginDescriptorFinder.kt │ │ │ │ ├── SpinnakerPluginDescriptorFinder.kt │ │ │ │ └── SpinnakerPropertiesPluginDescriptorFinder.kt │ │ │ │ ├── loaders │ │ │ │ ├── PluginRefPluginLoader.kt │ │ │ │ ├── SpinnakerDefaultPluginLoader.kt │ │ │ │ ├── SpinnakerDevelopmentPluginLoader.kt │ │ │ │ ├── SpinnakerJarPluginLoader.kt │ │ │ │ └── UnsafePluginClassLoader.kt │ │ │ │ ├── package.kt │ │ │ │ ├── pluginref │ │ │ │ └── PluginRef.kt │ │ │ │ ├── proxy │ │ │ │ ├── ExtensionInvocationProxy.kt │ │ │ │ ├── LazyExtensionInvocationProxy.kt │ │ │ │ └── aspects │ │ │ │ │ ├── InvocationAspect.kt │ │ │ │ │ ├── LogInvocationAspect.kt │ │ │ │ │ ├── MetricInvocationAspect.kt │ │ │ │ │ └── states.kt │ │ │ │ ├── remote │ │ │ │ ├── RemotePlugin.kt │ │ │ │ ├── RemotePluginConfigChangedListener.kt │ │ │ │ ├── RemotePluginsCache.kt │ │ │ │ ├── RemotePluginsProvider.kt │ │ │ │ └── extension │ │ │ │ │ ├── RemoteExtension.kt │ │ │ │ │ ├── RemoteExtensionPointConfig.kt │ │ │ │ │ ├── RemoteExtensionPointDefinition.kt │ │ │ │ │ └── transport │ │ │ │ │ ├── RemoteExtensionPayload.kt │ │ │ │ │ ├── RemoteExtensionQuery.kt │ │ │ │ │ ├── RemoteExtensionResponse.kt │ │ │ │ │ ├── RemoteExtensionTransport.kt │ │ │ │ │ └── http │ │ │ │ │ └── OkHttpRemoteExtensionTransport.kt │ │ │ │ ├── repository │ │ │ │ └── PluginRefPluginRepository.kt │ │ │ │ ├── sdk │ │ │ │ ├── IdResolver.kt │ │ │ │ ├── PluginSdksImpl.kt │ │ │ │ ├── SdkFactory.kt │ │ │ │ ├── httpclient │ │ │ │ │ ├── HttpClientSdkFactory.kt │ │ │ │ │ ├── Ok3HttpClient.kt │ │ │ │ │ ├── Ok3HttpClientRegistry.kt │ │ │ │ │ ├── Ok3Response.kt │ │ │ │ │ ├── OkHttp3ClientFactory.kt │ │ │ │ │ └── internal │ │ │ │ │ │ ├── CompositeOkHttpClientFactory.kt │ │ │ │ │ │ └── DefaultOkHttp3ClientFactory.kt │ │ │ │ ├── serde │ │ │ │ │ ├── SerdeServiceImpl.kt │ │ │ │ │ └── SerdeServiceSdkFactory.kt │ │ │ │ └── yaml │ │ │ │ │ ├── JacksonYamlResourceLoader.kt │ │ │ │ │ └── YamlResourceLoaderSdkFactory.kt │ │ │ │ ├── update │ │ │ │ ├── EnvironmentServerGroupLocationResolver.kt │ │ │ │ ├── EnvironmentServerGroupNameResolver.kt │ │ │ │ ├── ServerGroupLocationResolver.kt │ │ │ │ ├── ServerGroupNameResolver.kt │ │ │ │ ├── SpinnakerUpdateManager.kt │ │ │ │ ├── downloader │ │ │ │ │ ├── CompositeFileDownloader.kt │ │ │ │ │ ├── FileDownloaderProvider.kt │ │ │ │ │ ├── Front50FileDownloader.kt │ │ │ │ │ ├── ProcessFileDownloader.kt │ │ │ │ │ ├── ProcessFileDownloaderConfig.kt │ │ │ │ │ ├── SupportingFileDownloader.kt │ │ │ │ │ └── internal │ │ │ │ │ │ └── DefaultProcessRunner.kt │ │ │ │ ├── internal │ │ │ │ │ ├── Front50Service.kt │ │ │ │ │ ├── PluginOkHttpClientProvider.kt │ │ │ │ │ └── SpinnakerPluginInfo.kt │ │ │ │ ├── release │ │ │ │ │ ├── PluginInfoRelease.kt │ │ │ │ │ ├── provider │ │ │ │ │ │ ├── AggregatePluginInfoReleaseProvider.kt │ │ │ │ │ │ └── PluginInfoReleaseProvider.kt │ │ │ │ │ ├── remote │ │ │ │ │ │ └── RemotePluginInfoReleaseCache.kt │ │ │ │ │ └── source │ │ │ │ │ │ ├── Front50PluginInfoReleaseSource.kt │ │ │ │ │ │ ├── LatestPluginInfoReleaseSource.kt │ │ │ │ │ │ ├── PluginInfoReleaseSource.kt │ │ │ │ │ │ ├── PreferredPluginInfoReleaseSource.kt │ │ │ │ │ │ └── SpringPluginInfoReleaseSource.kt │ │ │ │ └── repository │ │ │ │ │ ├── ConfigurableUpdateRepository.kt │ │ │ │ │ └── Front50UpdateRepository.kt │ │ │ │ └── v2 │ │ │ │ ├── ApplicationContextGraph.kt │ │ │ │ ├── ApplicationEventListenerBeanPostProcessor.kt │ │ │ │ ├── AsyncSpringEventListenerAdapter.kt │ │ │ │ ├── PluginContainer.kt │ │ │ │ ├── PluginFrameworkInitializer.kt │ │ │ │ ├── SpinnakerPluginService.kt │ │ │ │ ├── SpringEventListenerAdapter.kt │ │ │ │ ├── SpringPluginFactory.kt │ │ │ │ ├── SpringPluginInitializer.kt │ │ │ │ ├── context │ │ │ │ ├── ComponentScanningCustomizer.kt │ │ │ │ ├── PluginApplicationContextCustomizer.kt │ │ │ │ ├── PluginConfigurationRegisteringCustomizer.kt │ │ │ │ └── PluginSdksRegisteringCustomizer.kt │ │ │ │ └── dsl.kt │ │ └── resources │ │ │ └── META-INF │ │ │ └── spring.factories │ └── test │ │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ └── plugins │ │ │ └── testplugin │ │ │ └── unsafe │ │ │ ├── UnsafeTestExtension.java │ │ │ └── UnsafeTestPlugin.java │ │ ├── kotlin │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ ├── plugins │ │ │ ├── CanonicalPluginIdTest.kt │ │ │ ├── DependencyInjectionTest.kt │ │ │ ├── ExtensionBeanDefinitionRegistryPostProcessorTest.kt │ │ │ ├── PluginSecretTest.kt │ │ │ ├── PluginSystemTest.kt │ │ │ ├── PluginsConfigurationPropertiesTest.kt │ │ │ ├── SpinnakerPluginManagerTest.kt │ │ │ ├── SpinnakerServiceVersionManagerTest.kt │ │ │ ├── SpringPluginStatusProviderTest.kt │ │ │ ├── SpringStrictPluginLoaderStatusProviderTest.kt │ │ │ ├── VersionRequirementsParserTest.kt │ │ │ ├── actuator │ │ │ │ └── InstalledPluginsEndpointTest.kt │ │ │ ├── bundle │ │ │ │ └── PluginBundleExtractorTest.kt │ │ │ ├── config │ │ │ │ ├── ConfigFactoryTest.kt │ │ │ │ └── SpringEnvironmentConfigResolverTest.kt │ │ │ ├── finders │ │ │ │ ├── PluginRefPluginDescriptorFinderTests.kt │ │ │ │ ├── SpinnakerManifestPluginDescriptorFinderTest.kt │ │ │ │ ├── SpinnakerPluginDescriptorFinderTest.kt │ │ │ │ ├── SpinnakerPropertiesPluginDescriptorFinderTest.kt │ │ │ │ └── types.kt │ │ │ ├── internal │ │ │ │ └── TestPlugin.kt │ │ │ ├── loaders │ │ │ │ └── SpinnakerPluginLoaderTests.kt │ │ │ ├── proxy │ │ │ │ └── aspects │ │ │ │ │ ├── LogInvocationAspectTest.kt │ │ │ │ │ ├── MetricInvocationAspectTest.kt │ │ │ │ │ └── utils.kt │ │ │ ├── remote │ │ │ │ ├── RemotePluginConfigChangedListenerTest.kt │ │ │ │ ├── RemotePluginsProviderTest.kt │ │ │ │ └── extension │ │ │ │ │ ├── RemoteExtensionTest.kt │ │ │ │ │ └── transport │ │ │ │ │ └── OkHttpRemoteExtensionTransportTest.kt │ │ │ ├── sdk │ │ │ │ ├── SerdeServiceImplTest.kt │ │ │ │ ├── httpclient │ │ │ │ │ ├── Ok3HttpClientIntegrationTest.kt │ │ │ │ │ ├── Ok3HttpClientRegistryTest.kt │ │ │ │ │ ├── Ok3HttpClientTest.kt │ │ │ │ │ └── Ok3ResponseTest.kt │ │ │ │ └── yaml │ │ │ │ │ └── JacksonYamlResourceLoaderTest.kt │ │ │ ├── update │ │ │ │ ├── EnvironmentServerGroupLocationResolverTest.kt │ │ │ │ ├── EnvironmentServerGroupNameResolverTest.kt │ │ │ │ ├── SpinnakerUpdateManagerTest.kt │ │ │ │ ├── downloader │ │ │ │ │ ├── FileDownloaderProviderTest.kt │ │ │ │ │ ├── Front50FileDownloaderTest.kt │ │ │ │ │ └── ProcessFileDownloaderTest.kt │ │ │ │ ├── release │ │ │ │ │ ├── provider │ │ │ │ │ │ └── AggregatePluginInfoReleaseProviderTest.kt │ │ │ │ │ ├── release_plugins.kt │ │ │ │ │ ├── remote │ │ │ │ │ │ └── RemotePluginConfigChangedListenerTest.kt │ │ │ │ │ └── source │ │ │ │ │ │ ├── Front50PluginInfoReleaseSourceTest.kt │ │ │ │ │ │ ├── LatestPluginInfoReleaseSourceTest.kt │ │ │ │ │ │ ├── PreferredPluginInfoReleaseSourceTest.kt │ │ │ │ │ │ └── SpringPluginInfoReleaseSourceTest.kt │ │ │ │ └── repository │ │ │ │ │ └── Front50UpdateRepositoryTest.kt │ │ │ └── v2 │ │ │ │ ├── ApplicationEventListenerBeanPostProcessorTest.kt │ │ │ │ ├── SpringEventListenerAdapterTest.kt │ │ │ │ ├── SpringPluginInitializerTest.kt │ │ │ │ ├── scenarios │ │ │ │ ├── ComplexInjectionScenarioTest.kt │ │ │ │ ├── ServiceDependenciesScenarioTest.kt │ │ │ │ ├── ServiceInjectionScenarioTest.kt │ │ │ │ └── fixtures │ │ │ │ │ └── ParentServiceBean.kt │ │ │ │ └── testdsl.kt │ │ │ └── version │ │ │ └── ServiceVersionTest.kt │ │ └── resources │ │ ├── bundle │ │ ├── deck │ │ │ └── index.js │ │ └── orca │ │ │ └── hello.txt │ │ ├── descriptor.mf │ │ ├── descriptor.properties │ │ ├── test.plugin-ref │ │ ├── testplugin │ │ ├── plugin-empty-config.yml │ │ └── plugin.properties │ │ ├── unsafe-testplugin │ │ └── plugin.properties │ │ └── yaml │ │ ├── sampleobject.yml │ │ └── test.yml └── v2-plugin-framework.png ├── kork-proto ├── kork-proto.gradle └── src │ └── main │ └── proto │ └── stats │ └── log.proto ├── kork-pubsub-aws ├── kork-pubsub-aws.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── pubsub │ │ └── aws │ │ ├── AmazonSubscriptionInformation.java │ │ ├── DefaultAmazonMessageAcknowledger.java │ │ ├── MessageAttribute.java │ │ ├── NotificationMessage.java │ │ ├── PubSubUtils.java │ │ ├── SNSPublisher.java │ │ ├── SNSPublisherProvider.java │ │ ├── SQSSubscriber.java │ │ ├── SQSSubscriberProvider.java │ │ ├── api │ │ ├── AmazonMessageAcknowledger.java │ │ ├── AmazonPubsubMessageHandler.java │ │ └── AmazonPubsubMessageHandlerFactory.java │ │ └── config │ │ ├── AmazonPubsubConfig.java │ │ └── AmazonPubsubProperties.java │ └── test │ ├── groovy │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── pubsub │ │ └── aws │ │ ├── NotificationMessageSpec.groovy │ │ └── PubSubUtilsSpec.groovy │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── pubsub │ └── aws │ └── SQSSubscriberTest.java ├── kork-pubsub ├── README.md ├── kork-pubsub.gradle └── src │ └── main │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── pubsub │ ├── PubsubPublishers.java │ ├── PubsubSubscribers.java │ ├── config │ └── PubsubConfig.java │ └── model │ ├── MessageAcknowledger.java │ ├── PubsubPublisher.java │ └── PubsubSubscriber.java ├── kork-retrofit ├── kork-retrofit.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ ├── config │ │ │ └── RetrofitErrorConfiguration.java │ │ │ └── kork │ │ │ └── retrofit │ │ │ ├── ErrorHandlingExecutorCallAdapterFactory.java │ │ │ ├── Retrofit2SyncCall.java │ │ │ ├── RetrofitServiceFactory.java │ │ │ ├── RetrofitServiceFactoryAutoConfiguration.java │ │ │ └── exceptions │ │ │ ├── SpinnakerConversionException.java │ │ │ ├── SpinnakerHttpException.java │ │ │ ├── SpinnakerNetworkException.java │ │ │ ├── SpinnakerRetrofitErrorHandler.java │ │ │ ├── SpinnakerRetrofitExceptionHandlers.java │ │ │ └── SpinnakerServerException.java │ └── resources │ │ └── META-INF │ │ ├── spring.factories │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ └── test │ ├── java │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── retrofit │ │ └── exceptions │ │ ├── Retrofit2SyncCallTest.java │ │ ├── SpinnakerHttpExceptionTest.java │ │ ├── SpinnakerRetrofit2ErrorHandleTest.java │ │ ├── SpinnakerRetrofitErrorHandlerTest.java │ │ ├── SpinnakerRetrofitExceptionHandlersTest.java │ │ └── SpinnakerServerExceptionTest.java │ ├── kotlin │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── retrofit │ │ └── RetrofitServiceProviderTest.kt │ └── resources │ └── mockito-extensions │ └── org.mockito.plugins.MockMaker ├── kork-retrofit2 ├── kork-retrofit2.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ └── retrofit │ │ │ ├── Retrofit2ConfigurationProperties.java │ │ │ ├── Retrofit2ServiceFactory.java │ │ │ └── Retrofit2ServiceFactoryAutoConfiguration.java │ └── resources │ │ └── META-INF │ │ ├── spring.factories │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ └── test │ ├── java │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── retrofit │ │ └── Retrofit2ServiceFactoryTest.java │ └── kotlin │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── retrofit │ └── Retrofit2ServiceProviderTest.kt ├── kork-runtime ├── README.md └── kork-runtime.gradle ├── kork-secrets-aws ├── kork-secrets-aws.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── secrets │ │ └── engines │ │ ├── S3ConfigurationProperties.java │ │ ├── S3SecretEngine.java │ │ ├── SecretsManagerClientProvider.java │ │ ├── SecretsManagerConfiguration.java │ │ └── SecretsManagerSecretEngine.java │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── secrets │ └── engines │ ├── SecretsManagerConfigurationTest.java │ ├── SecretsManagerSecretEngineIntegrationTest.java │ └── SecretsManagerSecretEngineTest.java ├── kork-secrets-gcp ├── kork-secrets-gcp.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── secrets │ │ └── engines │ │ ├── GcsSecretEngine.java │ │ ├── GoogleSecretsManagerSecretEngine.java │ │ └── GoogleUtils.java │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── secrets │ └── engines │ └── GoogleSecretsManagerSecretEngineTest.java ├── kork-secrets ├── kork-secrets.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ └── secrets │ │ │ ├── EncryptedSecret.java │ │ │ ├── InvalidSecretFormatException.java │ │ │ ├── SecretAwarePropertySource.java │ │ │ ├── SecretAwarePropertySourceRegistrar.java │ │ │ ├── SecretConfiguration.java │ │ │ ├── SecretDecryptionException.java │ │ │ ├── SecretEngine.java │ │ │ ├── SecretEngineRegistry.java │ │ │ ├── SecretException.java │ │ │ ├── SecretManager.java │ │ │ ├── SecretPropertyProcessor.java │ │ │ ├── SecretSession.java │ │ │ ├── StandardSecretParameter.java │ │ │ ├── engines │ │ │ ├── AbstractStorageSecretEngine.java │ │ │ └── NoopSecretEngine.java │ │ │ └── user │ │ │ ├── DefaultUserSecretSerde.java │ │ │ ├── OpaqueUserSecretData.java │ │ │ ├── StringUserSecretData.java │ │ │ ├── StringUserSecretSerde.java │ │ │ ├── UserSecret.java │ │ │ ├── UserSecretData.java │ │ │ ├── UserSecretManager.java │ │ │ ├── UserSecretMetadata.java │ │ │ ├── UserSecretMetadataField.java │ │ │ ├── UserSecretMixin.java │ │ │ ├── UserSecretReference.java │ │ │ ├── UserSecretSerde.java │ │ │ ├── UserSecretSerdeFactory.java │ │ │ ├── UserSecretType.java │ │ │ └── UserSecretTypeProvider.java │ └── resources │ │ └── META-INF │ │ ├── spring.factories │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── secrets │ ├── EncryptedSecretTest.java │ ├── SecretAwarePropertySourceTest.java │ ├── SecretManagerTest.java │ ├── SecretSessionTest.java │ ├── engines │ └── AbstractStorageEngineTest.java │ └── user │ ├── UserSecretManagerTest.java │ ├── UserSecretReferenceTest.java │ └── UserSecretSerdeTest.java ├── kork-security ├── kork-security.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── security │ │ ├── AbstractPermissionEvaluator.java │ │ ├── AccessControlled.java │ │ ├── AllowedAccountsAuthorities.java │ │ ├── AuthenticatedRequest.java │ │ ├── AuthenticatedRequestDecorator.java │ │ ├── Authorization.java │ │ ├── AuthorizationMapControlled.java │ │ ├── PermissionMapControlled.java │ │ ├── SpinnakerAuthorities.java │ │ ├── SpinnakerUsers.java │ │ ├── User.java │ │ └── UserPermissionEvaluator.java │ └── test │ └── groovy │ └── com │ └── netflix │ └── spinnaker │ └── security │ ├── AccessControlledSpec.groovy │ ├── AllowedAccountsAuthoritiesSpec.groovy │ ├── AuthenticatedRequestSpec.groovy │ ├── AuthorizationSpec.groovy │ ├── MDCSpec.groovy │ ├── SpinnakerAuthoritiesSpec.groovy │ ├── SpinnakerUsersSpec.groovy │ └── UserSpec.groovy ├── kork-sql-test ├── kork-sql-test.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── sql │ │ └── test │ │ └── SqlTestUtil.java │ └── test │ ├── java │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── sql │ │ └── test │ │ └── SqlTestUtilTest.java │ └── resources │ └── logback.xml ├── kork-sql ├── kork-sql.gradle └── src │ ├── main │ ├── kotlin │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ └── sql │ │ │ ├── JooqSqlCommentAppender.kt │ │ │ ├── JooqToSpringExceptionTransformer.kt │ │ │ ├── PagedIterator.kt │ │ │ ├── config │ │ │ ├── ConnectionPoolProperties.kt │ │ │ ├── DataSourceFactory.kt │ │ │ ├── DefaultSqlConfiguration.kt │ │ │ ├── HikariDataSourceConfiguration.kt │ │ │ ├── HikariDataSourceFactory.kt │ │ │ ├── SecondaryPoolDialectCondition.kt │ │ │ ├── SqlMigrationProperties.kt │ │ │ ├── SqlProperties.kt │ │ │ └── SqlRetryProperties.kt │ │ │ ├── health │ │ │ ├── SqlHealthIndicator.kt │ │ │ └── SqlHealthProvider.kt │ │ │ ├── migration │ │ │ └── SpringLiquibaseProxy.kt │ │ │ ├── routing │ │ │ ├── NamedDataSourceRouter.kt │ │ │ ├── NamedDatabaseContextHolder.kt │ │ │ ├── StaticDataSourceLookup.kt │ │ │ └── dsl.kt │ │ │ └── telemetry │ │ │ ├── HikariSpectatorMetricsTracker.kt │ │ │ ├── HikariSpectatorMetricsTrackerFactory.kt │ │ │ └── JooqSlowQueryLogger.kt │ └── resources │ │ └── db │ │ └── healthcheck.yml │ └── test │ ├── java │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── sql │ │ └── config │ │ ├── TransactionIsolationMysqlTest.java │ │ ├── TransactionIsolationTest.java │ │ └── TransactionIsolationValidationTest.java │ ├── kotlin │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── sql │ │ ├── PagedIteratorSpec.kt │ │ ├── SpringStartupTests.kt │ │ ├── SqlConfigurationTests.kt │ │ └── health │ │ └── SqlHealthProviderSpec.kt │ └── resources │ ├── application-test.yml │ ├── db │ └── changelog-master.yml │ ├── mockito-extensions │ └── org.mockito.plugins.MockMaker │ ├── mysql-set-global-transaction-isolation.sql │ └── mysql-set-session-transaction-isolation.sql ├── kork-stackdriver ├── kork-stackdriver.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ ├── spectator │ │ └── stackdriver │ │ │ ├── ConfigParams.java │ │ │ ├── MetricDescriptorCache.java │ │ │ ├── MonitoredResourceBuilder.java │ │ │ └── StackdriverWriter.java │ │ └── spinnaker │ │ └── config │ │ └── StackdriverConfig.java │ └── test │ └── java │ └── com │ └── netflix │ └── spectator │ └── stackdriver │ ├── MetricDescriptorCacheTest.java │ ├── MonitoredResourceBuilderTest.java │ └── StackdriverWriterTest.java ├── kork-swagger ├── kork-swagger.gradle └── src │ └── main │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── config │ └── SwaggerConfig.java ├── kork-telemetry ├── kork-telemetry.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── telemetry │ │ ├── InstrumentedProxy.java │ │ ├── MethodInstrumentation.java │ │ ├── MetricTags.java │ │ └── caffeine │ │ └── CaffeineStatsCounter.java │ └── test │ └── groovy │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── telemetry │ └── InstrumentedProxySpec.groovy ├── kork-test ├── kork-test.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ └── test │ │ │ ├── KorkTestException.java │ │ │ ├── MapUtils.java │ │ │ ├── log │ │ │ └── MemoryAppender.java │ │ │ ├── mimicker │ │ │ ├── DataContainer.java │ │ │ ├── Mimicker.java │ │ │ └── producers │ │ │ │ ├── MonikerProducer.java │ │ │ │ ├── NetworkProducer.java │ │ │ │ ├── RandomProducer.java │ │ │ │ ├── TextProducer.java │ │ │ │ └── aws │ │ │ │ ├── AwsArnProducer.java │ │ │ │ └── AwsProducer.java │ │ │ └── time │ │ │ └── MutableClock.java │ └── resources │ │ ├── mimicker-aws.yml │ │ └── mimicker.yml │ └── test │ ├── java │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── test │ │ └── log │ │ └── MemoryAppenderTest.java │ ├── kotlin │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── test │ │ └── mimicker │ │ ├── DataContainerTest.kt │ │ ├── MimickerTest.kt │ │ └── producers │ │ ├── MonikerProducerTest.kt │ │ └── RandomProducerTest.kt │ └── resources │ └── mimicker-foo.yml ├── kork-tomcat ├── kork-tomcat.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ └── kork │ │ │ └── tomcat │ │ │ ├── DefaultTomcatConnectorCustomizer.java │ │ │ ├── TomcatConfiguration.java │ │ │ ├── TomcatConfigurationProperties.java │ │ │ └── x509 │ │ │ ├── Blocklist.java │ │ │ ├── BlocklistEnabledDynamicConfigMonitor.java │ │ │ ├── BlocklistingJSSESocketFactory.java │ │ │ ├── BlocklistingSSLImplementation.java │ │ │ ├── BlocklistingX509TrustManager.java │ │ │ ├── ReloadingFileBlocklist.java │ │ │ └── SslExtensionConfigurationProperties.java │ └── resources │ │ └── META-INF │ │ ├── spring.factories │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ └── test │ └── java │ └── com │ └── netflix │ └── spinnaker │ └── kork │ └── tomcat │ ├── CRLFHeaderTest.java │ └── WebEnvironmentTest.java ├── kork-web ├── kork-web.gradle └── src │ ├── main │ ├── groovy │ │ └── com │ │ │ └── netflix │ │ │ └── spinnaker │ │ │ ├── config │ │ │ ├── ErrorConfiguration.groovy │ │ │ ├── MetricsEndpointConfiguration.java │ │ │ ├── OkHttp3ClientConfiguration.groovy │ │ │ ├── OkHttpMetricsInterceptorProperties.java │ │ │ └── RetrofitConfiguration.groovy │ │ │ ├── filters │ │ │ └── AuthenticatedRequestFilter.groovy │ │ │ ├── okhttp │ │ │ ├── OkHttpClientConfigurationProperties.groovy │ │ │ └── SpinnakerRequestInterceptor.groovy │ │ │ └── retrofit │ │ │ ├── Retrofit2ConfigurationProperties.java │ │ │ ├── RetrofitConfigurationProperties.java │ │ │ └── Slf4jRetrofitLogger.java │ └── java │ │ └── com │ │ └── netflix │ │ └── spinnaker │ │ ├── config │ │ ├── AuthenticatedRequestConfiguration.java │ │ ├── BinderControllerAdvice.java │ │ ├── DefaultServiceClientProvider.java │ │ ├── DefaultServiceEndpoint.java │ │ ├── OkHttpClientComponents.java │ │ ├── RequestContextConfiguration.java │ │ ├── ServiceEndpoint.java │ │ └── okhttp3 │ │ │ ├── DefaultOkHttpClientBuilderProvider.java │ │ │ ├── InsecureOkHttpClientBuilderProvider.java │ │ │ ├── OkHttpClientBuilderProvider.java │ │ │ ├── OkHttpClientCustomizer.java │ │ │ ├── OkHttpClientProvider.java │ │ │ ├── RawOkHttpClientConfiguration.java │ │ │ ├── RawOkHttpClientFactory.java │ │ │ ├── RefreshableOkHttpClientBuilderProvider.java │ │ │ └── package-info.java │ │ ├── kork │ │ ├── client │ │ │ ├── ServiceClientFactory.java │ │ │ └── ServiceClientProvider.java │ │ └── web │ │ │ ├── context │ │ │ ├── AuthenticatedRequestContext.java │ │ │ ├── AuthenticatedRequestContextProvider.java │ │ │ ├── MdcCopyingAsyncTaskExecutor.java │ │ │ ├── RequestContext.java │ │ │ └── RequestContextProvider.java │ │ │ ├── controllers │ │ │ └── GenericErrorController.java │ │ │ ├── exceptions │ │ │ ├── BaseExceptionHandlers.java │ │ │ ├── ExceptionMessageDecorator.java │ │ │ ├── ExceptionSummaryService.java │ │ │ └── GenericExceptionHandlers.java │ │ │ ├── interceptors │ │ │ ├── Criticality.java │ │ │ └── MetricsInterceptor.java │ │ │ └── selector │ │ │ ├── ByAccountServiceSelector.java │ │ │ ├── ByApplicationServiceSelector.java │ │ │ ├── ByAuthenticatedUserServiceSelector.java │ │ │ ├── ByCloudProviderServiceSelector.java │ │ │ ├── ByExecutionTypeServiceSelector.java │ │ │ ├── ByLocationServiceSelector.java │ │ │ ├── ByOriginServiceSelector.java │ │ │ ├── DefaultServiceSelector.java │ │ │ ├── SelectableService.java │ │ │ ├── ServiceSelector.java │ │ │ └── v2 │ │ │ └── SelectableService.java │ │ └── okhttp │ │ ├── MetricsInterceptor.java │ │ ├── OkHttp3MetricsInterceptor.java │ │ ├── Retrofit2EncodeCorrectionInterceptor.java │ │ └── SpinnakerRequestHeaderInterceptor.java │ └── test │ ├── groovy │ └── com │ │ └── netflix │ │ └── spinnaker │ │ └── kork │ │ └── web │ │ ├── config │ │ └── MetricsEndpointConfigurationTest.java │ │ ├── exceptions │ │ ├── ExceptionMessageDecoratorSpec.groovy │ │ ├── ExceptionSummaryServiceSpec.groovy │ │ ├── GenericExceptionHandlersMvcSpec.groovy │ │ ├── GenericExceptionHandlersSpec.groovy │ │ └── utils.groovy │ │ ├── interceptors │ │ ├── MetricsInterceptorMicrometerTest.java │ │ └── MetricsInterceptorSpec.groovy │ │ └── selector │ │ ├── SelectableServiceSpec.groovy │ │ └── v2 │ │ └── SelectableServiceSpec.groovy │ └── java │ └── com │ └── netflix │ └── spinnaker │ ├── config │ ├── OkHttp3ClientConfigurationTest.java │ ├── OkHttpClientComponentsTest.java │ └── okhttp3 │ │ ├── OkHttpClientProviderTest.java │ │ └── RefreshableOkHttpClientBuilderProviderTest.java │ ├── kork │ └── web │ │ └── context │ │ └── MdcCopyingAsyncTaskExecutorTest.java │ └── okhttp │ ├── Retrofit1ImpactTest.java │ ├── Retrofit2EncodeCorrectionInterceptorTest.java │ ├── SpinnakerRequestHeaderInterceptorTest.java │ └── SpinnakerRequestInterceptorTest.java ├── lombok.config ├── settings.gradle └── spinnaker-dependencies └── spinnaker-dependencies.gradle /.detekt.yml: -------------------------------------------------------------------------------- 1 | complexity: 2 | TooManyFunctions: 3 | active: false 4 | 5 | style: 6 | ThrowsCount: 7 | active: false 8 | MaxLineLength: 9 | active: false 10 | ReturnCount: 11 | active: false 12 | 13 | performance: 14 | SpreadOperator: 15 | active: false 16 | 17 | comments: 18 | UndocumentedPublicClass: 19 | active: true 20 | UndocumentedPublicFunction: 21 | active: true 22 | UndocumentedPublicProperty: 23 | active: true 24 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | indent_style = space 9 | indent_size = 2 -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for GitHub Actions 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "monthly" 8 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Branch Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - version-* 8 | 9 | env: 10 | GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g 11 | 12 | jobs: 13 | branch-build: 14 | # Only run this on repositories in the 'spinnaker' org, not on forks. 15 | if: startsWith(github.repository, 'spinnaker/') 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v4 19 | - uses: actions/setup-java@v4 20 | with: 21 | java-version: | 22 | 17 23 | distribution: 'zulu' 24 | cache: 'gradle' 25 | - name: Build 26 | run: ./gradlew -PenableCrossCompilerPlugin=true build --stacktrace 27 | -------------------------------------------------------------------------------- /.github/workflows/gradle-wrapper-validation.yml: -------------------------------------------------------------------------------- 1 | name: "Validate Gradle Wrapper" 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | validation: 6 | name: "Gradle wrapper validation" 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | - uses: gradle/wrapper-validation-action@v3 11 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | name: PR Build 2 | 3 | on: [ pull_request ] 4 | 5 | env: 6 | GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: actions/setup-java@v4 14 | with: 15 | java-version: | 16 | 17 17 | distribution: 'zulu' 18 | cache: 'gradle' 19 | - name: Build 20 | run: ./gradlew -PenableCrossCompilerPlugin=true build 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | build/ 3 | /.idea/ 4 | *.iml 5 | *.ipr 6 | *.iws 7 | *.DS_Store 8 | out/ 9 | 10 | .classpath 11 | .vscode 12 | .settings 13 | .project 14 | bin 15 | -------------------------------------------------------------------------------- /.idea/README.md: -------------------------------------------------------------------------------- 1 | # Spinnaker IntelliJ IDEA files 2 | 3 | IntelliJ IDEA will modify some of these files from their checked-in versions when the project is 4 | opened. To work around this, the Spinnaker Gradle plugin will mark these files in Git as "assume 5 | unchanged", telling Git to ignore any local changes. If you want to commit changes to these files, 6 | you will need to undo that. 7 | 8 | ```bash 9 | $ git update-index --no-assume-unchanged $FILENAME 10 | ``` 11 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/copyright/ALS2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/google-java-format.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file with this pattern: 2 | # 3 | # For individuals: 4 | # Name 5 | # 6 | # For organizations: 7 | # Organization 8 | 9 | Netflix, Inc <*@netflix.com> 10 | Google, Inc <*@google.com> 11 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @spinnaker/sig-platform 2 | kork-artifacts.* @spinnaker/sig-spin-as-code 3 | kork-aws.* @spinnaker/sig-aws 4 | kork-plugins.* @spinnaker/plugins-working-group 5 | kork-secrets.* @spinnaker/sig-security 6 | kork-security.* @spinnaker/sig-security 7 | kork-stackdriver.* @spinnaker/sig-ops 8 | kork-telemetry.* @spinnaker/sig-ops 9 | -------------------------------------------------------------------------------- /OWNERS.md: -------------------------------------------------------------------------------- 1 | cfieber 2 | robfletcher 3 | robzienert 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://api.travis-ci.org/spinnaker/kork.svg?branch=master)](https://travis-ci.org/spinnaker/kork) 2 | 3 | Kork provides some basic service building blocks for Spinnaker. 4 | 5 | Additionally Kork adapts NetflixOSS platform components to Spring configuration and Spring-Boot autoconfiguration. 6 | 7 | This project provides Spring bindings for NetflixOSS components that are typically exposed and configured via the internal Netflix Platform. The exposed Bean bindings are set up with reasonable defaults and limited assumptions about the existence of other infrastructure services. Using Spring-Boot AutoConfiguration, they will only conditionally load in an environment where the internal Netflix platform is not available. 8 | -------------------------------------------------------------------------------- /autobump.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # wrapper script around running the merge or close auto bump PR 4 | # gradle tasks (ensures publishing is enabled and simplifies the 5 | # CLI for this specific use case). 6 | # 7 | # intended for use by a kork updater on their local dev environment 8 | # after a kork release build has completed and the PRs are ready 9 | # for merging (not intended as a CI type of script) 10 | # 11 | # to use, you will need github.token set in your 12 | # ~/.gradle/gradle.properties file or GITHUB_TOKEN present as an 13 | # environment variable 14 | # 15 | 16 | SCRIPT_DIR=`dirname $0` 17 | 18 | GRADLE="$SCRIPT_DIR/gradlew -b $SCRIPT_DIR/build.gradle -PenablePublishing=true" 19 | 20 | if [[ ! -z ${GITHUB_TOKEN} ]]; then 21 | GRADLE="$GRADLE -Pgithub.token=$GITHUB_TOKEN" 22 | fi 23 | 24 | case $1 in 25 | merge) 26 | $GRADLE mergeAllAutoBumpPRs 27 | ;; 28 | 29 | close) 30 | $GRADLE closeAllAutoBumpPRs 31 | ;; 32 | 33 | *) 34 | echo "usage: $0 " 35 | echo " merge - merge all mergeable kork autobump PRs" 36 | echo " close - close all open kork autobump PRs" 37 | esac 38 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | kotlinVersion=1.6.21 2 | org.gradle.parallel=true 3 | spinnakerGradleVersion=8.32.1 4 | targetJava17=true 5 | includeRuntimes=actuator,core,eureka,retrofit,secrets-aws,secrets-gcp,stackdriver,swagger,tomcat,web 6 | 7 | org.gradle.jvmargs=-Xmx2g -Xms2g 8 | -------------------------------------------------------------------------------- /gradle/lombok.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compileOnly "org.projectlombok:lombok" 3 | compileOnly(platform(project(":spinnaker-dependencies"))) 4 | annotationProcessor "org.projectlombok:lombok" 5 | annotationProcessor(platform(project(":spinnaker-dependencies"))) 6 | testCompileOnly "org.projectlombok:lombok" 7 | testCompileOnly(platform(project(":spinnaker-dependencies"))) 8 | testAnnotationProcessor(platform(project(":spinnaker-dependencies"))) 9 | testAnnotationProcessor "org.projectlombok:lombok" 10 | } 11 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spinnaker/kork/a7b6fdea15ec2e98c80093947f194afb0ee552f3/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /kork-actuator/src/main/java/com/netflix/spinnaker/kork/actuator/endpoint/ResolvedEnvironmentConfigurationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package com.netflix.spinnaker.kork.actuator.endpoint; 18 | 19 | import java.util.List; 20 | import org.springframework.boot.context.properties.ConfigurationProperties; 21 | 22 | @ConfigurationProperties(prefix = "endpoints.resolved-env") 23 | public class ResolvedEnvironmentConfigurationProperties { 24 | 25 | List keysToSanitize = null; 26 | 27 | public List getKeysToSanitize() { 28 | return keysToSanitize; 29 | } 30 | 31 | public void setKeysToSanitize(List keysToSanitize) { 32 | this.keysToSanitize = keysToSanitize; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /kork-actuator/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spinnaker/kork/a7b6fdea15ec2e98c80093947f194afb0ee552f3/kork-actuator/src/main/resources/META-INF/spring.factories -------------------------------------------------------------------------------- /kork-actuator/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.kork.actuator.ActuatorEndpointsConfiguration 2 | com.netflix.spinnaker.kork.actuator.ResolvedEnvEndpointAutoConfiguration 3 | -------------------------------------------------------------------------------- /kork-annotations/kork-annotations.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | apply plugin: "java-library" 18 | 19 | dependencies { 20 | api(platform(project(":spinnaker-dependencies"))) 21 | api("com.google.code.findbugs:jsr305") 22 | } 23 | -------------------------------------------------------------------------------- /kork-annotations/src/main/java/com/netflix/spinnaker/kork/annotations/FieldsAreNonnullByDefault.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Google, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.meta.TypeQualifierDefault; 24 | 25 | /** 26 | * Defaults all fields within annotation's scope to @Nonnull, unless a more tightly-scoped 27 | * annotation is applied. 28 | */ 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Nonnull 31 | @TypeQualifierDefault({ElementType.FIELD}) 32 | public @interface FieldsAreNonnullByDefault {} 33 | -------------------------------------------------------------------------------- /kork-annotations/src/main/java/com/netflix/spinnaker/kork/annotations/FieldsAreNullableByDefault.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Google, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import javax.annotation.Nullable; 23 | import javax.annotation.meta.TypeQualifierDefault; 24 | 25 | /** 26 | * Defaults all fields within annotation's scope to @Nullable, unless a more tightly-scoped 27 | * annotation is applied. 28 | */ 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Nullable 31 | @TypeQualifierDefault({ElementType.FIELD}) 32 | public @interface FieldsAreNullableByDefault {} 33 | -------------------------------------------------------------------------------- /kork-annotations/src/main/java/com/netflix/spinnaker/kork/annotations/MethodsReturnNonnullByDefault.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Google, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.meta.TypeQualifierDefault; 24 | 25 | /** 26 | * Defaults all methods within annotation's scope to return @Nonnull, unless a more tightly-scoped 27 | * annotation is applied. 28 | */ 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Nonnull 31 | @TypeQualifierDefault({ElementType.METHOD}) 32 | public @interface MethodsReturnNonnullByDefault {} 33 | -------------------------------------------------------------------------------- /kork-annotations/src/main/java/com/netflix/spinnaker/kork/annotations/MethodsReturnNullableByDefault.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Google, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import javax.annotation.Nullable; 23 | import javax.annotation.meta.TypeQualifierDefault; 24 | 25 | /** 26 | * Defaults all methods within annotation's scope to return @Nullable, unless a more tightly-scoped 27 | * annotation is applied. 28 | */ 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Nullable 31 | @TypeQualifierDefault({ElementType.METHOD}) 32 | public @interface MethodsReturnNullableByDefault {} 33 | -------------------------------------------------------------------------------- /kork-api/kork-api.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/lombok.gradle" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | api project(":kork-plugins-api") 7 | 8 | implementation project(":kork-annotations") 9 | 10 | testImplementation "org.assertj:assertj-core" 11 | testImplementation "org.junit.jupiter:junit-jupiter-api" 12 | testImplementation "org.junit.jupiter:junit-jupiter-params" 13 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" 14 | } 15 | -------------------------------------------------------------------------------- /kork-api/src/main/java/com/netflix/spinnaker/kork/api/exceptions/ExceptionDetails.java: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.api.exceptions; 2 | 3 | /** 4 | * Marker interface to represent any additional exception details that may be helpful when 5 | * assembling an exception message via {@link ExceptionMessage}. 6 | */ 7 | public interface ExceptionDetails {} 8 | -------------------------------------------------------------------------------- /kork-api/src/main/java/com/netflix/spinnaker/kork/api/exceptions/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | @NonnullByDefault 18 | package com.netflix.spinnaker.kork.api.exceptions; 19 | 20 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 21 | -------------------------------------------------------------------------------- /kork-api/src/main/java/com/netflix/spinnaker/kork/api/expressions/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | @NonnullByDefault 18 | package com.netflix.spinnaker.kork.api.expressions; 19 | 20 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 21 | -------------------------------------------------------------------------------- /kork-artifacts/kork-artifacts.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/lombok.gradle" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | 7 | implementation project(":kork-annotations") 8 | implementation project(":kork-exceptions") 9 | implementation project(":kork-security") 10 | implementation "com.fasterxml.jackson.core:jackson-databind" 11 | api 'software.amazon.awssdk:s3' 12 | api 'software.amazon.awssdk:sts' 13 | implementation "org.apache.httpcomponents:httpclient" 14 | implementation "org.springframework.boot:spring-boot-autoconfigure" 15 | implementation "org.springframework.security:spring-security-core" 16 | implementation 'org.apache.logging.log4j:log4j-api' 17 | api "com.hubspot.jinjava:jinjava" 18 | 19 | testImplementation "org.assertj:assertj-core" 20 | testImplementation "org.junit.jupiter:junit-jupiter-api" 21 | testImplementation "org.junit.jupiter:junit-jupiter-params" 22 | testImplementation "org.mockito:mockito-core" 23 | testImplementation "org.springframework.boot:spring-boot-starter-test" 24 | testImplementation project(":kork-core") 25 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" 26 | } 27 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/ArtifactTypes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.artifacts; 17 | 18 | import lombok.Getter; 19 | import lombok.RequiredArgsConstructor; 20 | 21 | @RequiredArgsConstructor 22 | public enum ArtifactTypes { 23 | EMBEDDED_BASE64("embedded/base64"), 24 | REMOTE_BASE64("remote/base64"), 25 | ; 26 | 27 | @Getter private final String mimeType; 28 | } 29 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/artifactstore/ArtifactDecorator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.artifacts.artifactstore; 17 | 18 | import com.netflix.spinnaker.kork.artifacts.model.Artifact; 19 | 20 | /** Primarily used to set any custom fields to an artifact */ 21 | public interface ArtifactDecorator { 22 | Artifact.ArtifactBuilder decorate(Artifact.ArtifactBuilder builder); 23 | } 24 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/artifactstore/ArtifactStoreGetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Salesforce Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.artifacts.artifactstore; 17 | 18 | import com.netflix.spinnaker.kork.artifacts.model.Artifact; 19 | 20 | /** 21 | * ArtifactStoreGetter is an interface that allows for different types of artifact storage to be 22 | * used during runtime. 23 | */ 24 | public interface ArtifactStoreGetter { 25 | /** 26 | * get is used to return an artifact with some id, while also decorating that artifact with any 27 | * necessary fields needed which should be then be returned by the artifact store. 28 | */ 29 | public Artifact get(ArtifactReferenceURI uri, ArtifactDecorator... decorators); 30 | } 31 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/artifactstore/ArtifactStoreStorer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Salesforce Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.artifacts.artifactstore; 17 | 18 | import com.netflix.spinnaker.kork.artifacts.model.Artifact; 19 | 20 | /** 21 | * ArtifactStoreStorer is an interface that allows for different types of artifact storage to be 22 | * used during runtime. 23 | */ 24 | public interface ArtifactStoreStorer { 25 | 26 | Artifact store(Artifact artifact); 27 | } 28 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/artifactstore/NoopArtifactStoreGetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Salesforce Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.artifacts.artifactstore; 17 | 18 | import com.netflix.spinnaker.kork.artifacts.model.Artifact; 19 | 20 | /** A no-op ArtifactStoreGetter. In other words, don't actually get the artifact. */ 21 | public class NoopArtifactStoreGetter implements ArtifactStoreGetter { 22 | 23 | public Artifact get(ArtifactReferenceURI uri, ArtifactDecorator... decorators) { 24 | throw new IllegalStateException( 25 | "unable to retrieve artifact " 26 | + uri.toString() 27 | + " since there's no artifact store getter configured"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/artifactstore/NoopArtifactStoreStorer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Salesforce Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.artifacts.artifactstore; 17 | 18 | import com.netflix.spinnaker.kork.artifacts.model.Artifact; 19 | 20 | /** A no-op ArtifactStoreStorer. In other words, don't actually store the artifact. */ 21 | public class NoopArtifactStoreStorer implements ArtifactStoreStorer { 22 | 23 | public Artifact store(Artifact artifact) { 24 | return artifact; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/artifactstore/s3/S3ArtifactStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.artifacts.artifactstore.s3; 17 | 18 | public final class S3ArtifactStore { 19 | public static final String ENFORCE_PERMS_KEY = "application"; 20 | 21 | private S3ArtifactStore() {} 22 | } 23 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/parsing/ArtifactExtractor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Google, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.artifacts.parsing; 18 | 19 | import com.netflix.spinnaker.kork.artifacts.model.Artifact; 20 | import java.util.List; 21 | 22 | /** An interface for classes that translate arbitrary String messages into Spinnaker artifacts. */ 23 | public interface ArtifactExtractor { 24 | List getArtifacts(String messagePayload); 25 | } 26 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/parsing/DefaultJinjavaFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.artifacts.parsing; 18 | 19 | import com.hubspot.jinjava.Jinjava; 20 | 21 | /** 22 | * Creates a regular jinjava. You can overwrite this to create a custom jinjava with things like 23 | * custom filters and tags. 24 | */ 25 | public class DefaultJinjavaFactory implements JinjavaFactory { 26 | 27 | @Override 28 | public Jinjava create() { 29 | return new Jinjava(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/parsing/JinjavaFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.artifacts.parsing; 18 | 19 | import com.hubspot.jinjava.Jinjava; 20 | 21 | public interface JinjavaFactory { 22 | Jinjava create(); 23 | } 24 | -------------------------------------------------------------------------------- /kork-aws/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spinnaker/kork/a7b6fdea15ec2e98c80093947f194afb0ee552f3/kork-aws/src/main/resources/META-INF/spring.factories -------------------------------------------------------------------------------- /kork-aws/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.kork.aws.AwsComponents 2 | -------------------------------------------------------------------------------- /kork-bom/kork-bom.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-platform" 2 | 3 | javaPlatform { 4 | allowDependencies() 5 | } 6 | 7 | dependencies { 8 | api(platform(project(":spinnaker-dependencies"))) 9 | constraints { 10 | rootProject 11 | .subprojects 12 | .findAll { it.name.startsWith("kork-") && it != project } 13 | .each { api(project(it.path)) } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /kork-cloud-config-server/kork-cloud-config-server.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/lombok.gradle" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | 7 | implementation "commons-io:commons-io" 8 | implementation "org.apache.commons:commons-lang3" 9 | implementation project(':kork-secrets') 10 | implementation "org.springframework.cloud:spring-cloud-context" 11 | implementation "org.springframework.cloud:spring-cloud-config-server" 12 | implementation "io.awspring.cloud:spring-cloud-aws-context:2.3.5" 13 | 14 | testImplementation project(':kork-config') 15 | testImplementation "org.springframework.boot:spring-boot-starter-test" 16 | testImplementation "org.assertj:assertj-core" 17 | testImplementation "org.junit.jupiter:junit-jupiter-api" 18 | testImplementation "org.junit.jupiter:junit-jupiter-engine" 19 | testImplementation "org.junit.jupiter:junit-jupiter-params" 20 | testImplementation "org.mockito:mockito-core" 21 | 22 | } 23 | -------------------------------------------------------------------------------- /kork-cloud-config-server/src/main/java/com/netflix/spinnaker/kork/configserver/ConfigFileLoadingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Pivotal, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.configserver; 18 | 19 | public class ConfigFileLoadingException extends RuntimeException { 20 | public ConfigFileLoadingException(String message) { 21 | super(message); 22 | } 23 | 24 | public ConfigFileLoadingException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public ConfigFileLoadingException(Throwable cause) { 29 | super(cause); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kork-cloud-config-server/src/main/java/com/netflix/spinnaker/kork/configserver/autoconfig/SpringCloudAwsConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.configserver.autoconfig; 2 | 3 | import com.amazonaws.services.s3.AmazonS3Client; 4 | import com.amazonaws.services.s3.AmazonS3ClientBuilder; 5 | import org.springframework.cloud.config.server.environment.AwsS3EnvironmentProperties; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.context.annotation.Profile; 9 | 10 | @Profile("awss3") 11 | @Configuration 12 | class SpringCloudAwsConfiguration { 13 | 14 | @Bean 15 | public static AmazonS3Client amazonS3(AwsS3EnvironmentProperties s3EnvironmentProperties) { 16 | return (AmazonS3Client) 17 | AmazonS3ClientBuilder.standard().withRegion(s3EnvironmentProperties.getRegion()).build(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /kork-cloud-config-server/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.context.ApplicationListener=\ 2 | com.netflix.spinnaker.kork.configserver.CloudConfigApplicationListener 3 | -------------------------------------------------------------------------------- /kork-cloud-config-server/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.kork.configserver.autoconfig.CloudConfigAutoConfiguration 2 | com.netflix.spinnaker.kork.configserver.autoconfig.SpringCloudAwsConfiguration 3 | com.netflix.spinnaker.kork.configserver.autoconfig.SpringCloudAwsS3ResourceLoaderConfiguration 4 | io.awspring.cloud.context.config.annotation.ContextResourceLoaderConfiguration 5 | -------------------------------------------------------------------------------- /kork-cloud-config-server/src/main/resources/spinnakerconfig.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | # default Spring Cloud Config Server environment repository configuration 3 | # to something that won't prevent app startup when explicit configuration 4 | # is not provided 5 | cloud: 6 | config: 7 | server: 8 | composite: 9 | - type: native 10 | search-locations: ${user.home}/config 11 | -------------------------------------------------------------------------------- /kork-config/kork-config.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/lombok.gradle" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | 7 | implementation "commons-io:commons-io" 8 | implementation "org.apache.commons:commons-lang3" 9 | 10 | implementation project(':kork-secrets') 11 | 12 | testImplementation "org.springframework.boot:spring-boot-starter-test" 13 | testImplementation "org.assertj:assertj-core" 14 | testImplementation "org.junit.jupiter:junit-jupiter-api" 15 | testImplementation "org.junit.jupiter:junit-jupiter-engine" 16 | testImplementation "org.junit.jupiter:junit-jupiter-params" 17 | testImplementation "org.mockito:mockito-core" 18 | 19 | } 20 | -------------------------------------------------------------------------------- /kork-core-tck/kork-core-tck.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply plugin: "groovy" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | 7 | implementation(project(":kork-core")) 8 | implementation(project(":kork-exceptions")) 9 | 10 | implementation("org.apache.groovy:groovy") 11 | implementation("org.spockframework:spock-core") 12 | } 13 | -------------------------------------------------------------------------------- /kork-core/README.md: -------------------------------------------------------------------------------- 1 | # kork-core 2 | 3 | Provides core libraries for Spinnaker services 4 | 5 | # com.netflix.spinnaker.kork.discovery 6 | 7 | Offers service discovery integration for Spinnaker services. 8 | Spinnaker services are written to utilize service discovery status to actuate various functionality on and off; 9 | such as work queues, background jobs, and so-on. 10 | A reference implementation can be found in `kork-eureka`. 11 | -------------------------------------------------------------------------------- /kork-core/src/main/java/com/netflix/spinnaker/kork/discovery/DiscoveryStatusPublisher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package com.netflix.spinnaker.kork.discovery; 18 | 19 | /** Marker interface for publishing service discovery status. */ 20 | public interface DiscoveryStatusPublisher {} 21 | -------------------------------------------------------------------------------- /kork-core/src/main/java/com/netflix/spinnaker/kork/discovery/RemoteStatusChangedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.kork.discovery; 19 | 20 | import org.springframework.context.ApplicationEvent; 21 | 22 | /** A Spring {@link ApplicationEvent} wrapping the {@link DiscoveryStatusChangeEvent}. */ 23 | public class RemoteStatusChangedEvent extends ApplicationEvent { 24 | public RemoteStatusChangedEvent(DiscoveryStatusChangeEvent source) { 25 | super(source); 26 | } 27 | 28 | @Override 29 | public DiscoveryStatusChangeEvent getSource() { 30 | return (DiscoveryStatusChangeEvent) super.getSource(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /kork-core/src/main/java/com/netflix/spinnaker/kork/dynamicconfig/TransientConfigConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.dynamicconfig; 17 | 18 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 19 | import org.springframework.context.annotation.Bean; 20 | import org.springframework.context.annotation.Configuration; 21 | 22 | @Configuration 23 | public class TransientConfigConfiguration { 24 | 25 | @Bean 26 | @ConditionalOnMissingBean(DynamicConfigService.class) 27 | DynamicConfigService springTransientConfigService() { 28 | return new SpringDynamicConfigService(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /kork-core/src/main/java/com/netflix/spinnaker/kork/jackson/InvalidSubtypeConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.jackson; 17 | 18 | import com.netflix.spinnaker.kork.exceptions.SystemException; 19 | 20 | /** 21 | * Thrown when an ObjectMapperSubtypeConfigurer finds a subtype without a JsonTypeName annotation. 22 | */ 23 | public class InvalidSubtypeConfigurationException extends SystemException { 24 | 25 | public InvalidSubtypeConfigurationException(String s) { 26 | super(s); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /kork-core/src/main/java/com/netflix/spinnaker/kork/jackson/NamedTypeParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Apple, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.jackson; 18 | 19 | import com.fasterxml.jackson.databind.jsontype.NamedType; 20 | import javax.annotation.Nonnull; 21 | import javax.annotation.Nullable; 22 | 23 | /** Parses a class to determine its type discriminator. */ 24 | public interface NamedTypeParser { 25 | 26 | /** 27 | * Parses the given class and returns a NamedType if a type discriminator can be found or null 28 | * otherwise. 29 | */ 30 | @Nullable 31 | NamedType parse(@Nonnull Class type); 32 | } 33 | -------------------------------------------------------------------------------- /kork-core/src/main/java/com/netflix/spinnaker/kork/metrics/SpectatorGcLoggingConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.metrics; 18 | 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | 21 | /** SpectatorGcLoggingConfiguration. */ 22 | @ConfigurationProperties("spectator.gc") 23 | public class SpectatorGcLoggingConfiguration { 24 | private boolean loggingEnabled = true; 25 | 26 | public boolean isLoggingEnabled() { 27 | return loggingEnabled; 28 | } 29 | 30 | public void setLoggingEnabled(boolean loggingEnabled) { 31 | this.loggingEnabled = loggingEnabled; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kork-core/src/main/java/com/netflix/spinnaker/kork/version/VersionResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.version; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.Nullable; 20 | import org.springframework.core.Ordered; 21 | 22 | /** Defines a strategy for resolving a service version. */ 23 | public interface VersionResolver extends Ordered { 24 | 25 | /** Returns a service version, if one could be resolved. */ 26 | @Nullable 27 | String resolve(@Nonnull String serviceName); 28 | } 29 | -------------------------------------------------------------------------------- /kork-core/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.context.ApplicationListener=\ 2 | com.netflix.spinnaker.kork.spring.SpringBoot1CompatibilityApplicationListener,\ 3 | com.netflix.spinnaker.kork.web.exceptions.DefaultThreadUncaughtExceptionHandler 4 | -------------------------------------------------------------------------------- /kork-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.kork.PlatformComponents 2 | com.netflix.spinnaker.kork.discovery.DiscoveryAutoConfiguration 3 | -------------------------------------------------------------------------------- /kork-credentials-api/src/main/java/com/netflix/spinnaker/credentials/Credentials.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.credentials; 18 | 19 | /** Credentials to an external system. Each credentials has a unique name for its type. */ 20 | public interface Credentials { 21 | 22 | /** 23 | * Each credentials is uniquely identified by its name for a given type. 24 | * 25 | * @return Credentials name 26 | */ 27 | String getName(); 28 | 29 | /** @return Credentials type */ 30 | String getType(); 31 | } 32 | -------------------------------------------------------------------------------- /kork-credentials-api/src/main/java/com/netflix/spinnaker/credentials/NoopCredentialsLifecycleHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.credentials; 19 | 20 | public class NoopCredentialsLifecycleHandler 21 | implements CredentialsLifecycleHandler { 22 | @Override 23 | public void credentialsAdded(T credentials) {} 24 | 25 | @Override 26 | public void credentialsUpdated(T credentials) {} 27 | 28 | @Override 29 | public void credentialsDeleted(T credentials) {} 30 | } 31 | -------------------------------------------------------------------------------- /kork-credentials-api/src/main/java/com/netflix/spinnaker/credentials/definition/CredentialsDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.credentials.definition; 18 | 19 | import com.netflix.spinnaker.credentials.Credentials; 20 | 21 | /** 22 | * Contains properties that define {@link Credentials}. {@link CredentialsDefinition} can be POJOs 23 | * deserialized from configuration or an external system. These are optional but useful to use 24 | * built-in {@link CredentialsParser}. 25 | * 26 | *

equals is checked to detect change in definitions 27 | */ 28 | public interface CredentialsDefinition { 29 | String getName(); 30 | } 31 | -------------------------------------------------------------------------------- /kork-credentials-api/src/main/java/com/netflix/spinnaker/credentials/definition/CredentialsDefinitionSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.credentials.definition; 18 | 19 | import com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint; 20 | import java.util.List; 21 | 22 | /** 23 | * A source of credentials definitions. It could be backed by Spring properties or fetched from an 24 | * external system. 25 | * 26 | * @param 27 | */ 28 | public interface CredentialsDefinitionSource 29 | extends SpinnakerExtensionPoint { 30 | List getCredentialsDefinitions(); 31 | } 32 | -------------------------------------------------------------------------------- /kork-credentials-api/src/main/java/com/netflix/spinnaker/credentials/definition/CredentialsLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.credentials.definition; 18 | 19 | import com.netflix.spinnaker.credentials.Credentials; 20 | import com.netflix.spinnaker.credentials.CredentialsRepository; 21 | import com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint; 22 | 23 | public interface CredentialsLoader extends SpinnakerExtensionPoint { 24 | CredentialsRepository getCredentialsRepository(); 25 | 26 | void load(); 27 | } 28 | -------------------------------------------------------------------------------- /kork-credentials-api/src/main/java/com/netflix/spinnaker/credentials/definition/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | @NonnullByDefault 18 | package com.netflix.spinnaker.credentials.definition; 19 | 20 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 21 | -------------------------------------------------------------------------------- /kork-credentials-api/src/main/java/com/netflix/spinnaker/credentials/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | @NonnullByDefault 19 | package com.netflix.spinnaker.credentials; 20 | 21 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 22 | -------------------------------------------------------------------------------- /kork-credentials-api/src/test/java/com/netflix/spinnaker/credentials/definition/CredentialsDefinitionMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Apple, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.credentials.definition; 18 | 19 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 20 | 21 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") 22 | interface CredentialsDefinitionMixin {} 23 | -------------------------------------------------------------------------------- /kork-credentials-api/src/test/java/com/netflix/spinnaker/credentials/definition/TestCredentialsDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Apple, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.credentials.definition; 18 | 19 | import lombok.Builder; 20 | import lombok.Value; 21 | import lombok.extern.jackson.Jacksonized; 22 | 23 | @CredentialsType("test") 24 | @Value 25 | @Builder 26 | @Jacksonized 27 | public class TestCredentialsDefinition implements CredentialsDefinition { 28 | String name; 29 | } 30 | -------------------------------------------------------------------------------- /kork-credentials/src/main/java/com/netflix/spinnaker/credentials/jackson/SensitiveAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.credentials.jackson; 18 | 19 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 20 | import org.springframework.context.annotation.Configuration; 21 | import org.springframework.context.annotation.Import; 22 | 23 | /** 24 | * Adds {@link SensitiveSerializer} as a bean automatically when this module is on the classpath. 25 | */ 26 | @Configuration 27 | @EnableConfigurationProperties(SensitiveProperties.class) 28 | @Import(SensitiveSerializer.class) 29 | public class SensitiveAutoConfiguration {} 30 | -------------------------------------------------------------------------------- /kork-credentials/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kork-credentials/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.credentials.jackson.SensitiveAutoConfiguration 2 | -------------------------------------------------------------------------------- /kork-credentials/src/test/java/com/netflix/spinnaker/credentials/jackson/SensitiveAccount.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.credentials.jackson; 18 | 19 | import com.netflix.spinnaker.credentials.definition.CredentialsDefinition; 20 | import com.netflix.spinnaker.credentials.definition.CredentialsType; 21 | import javax.annotation.Nonnull; 22 | import lombok.Builder; 23 | import lombok.Value; 24 | import lombok.extern.jackson.Jacksonized; 25 | 26 | @CredentialsType("sensitive") 27 | @Value 28 | @Builder 29 | @Jacksonized 30 | public class SensitiveAccount implements CredentialsDefinition { 31 | @Nonnull String name; 32 | String username; 33 | @Sensitive String password; 34 | String token; 35 | } 36 | -------------------------------------------------------------------------------- /kork-crypto/kork-crypto.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | apply plugin: "java-library" 18 | apply plugin: "java-test-fixtures" 19 | apply from: "$rootDir/gradle/lombok.gradle" 20 | 21 | dependencies { 22 | api(platform(project(":spinnaker-dependencies"))) 23 | 24 | api project(":kork-annotations") 25 | 26 | implementation "org.bouncycastle:bcpkix-jdk18on" 27 | implementation "org.springframework:spring-aop" 28 | 29 | testImplementation "org.springframework.boot:spring-boot-starter-test" 30 | 31 | testFixturesApi "org.bouncycastle:bcpkix-jdk18on" 32 | testFixturesApi "org.springframework:spring-core" 33 | } 34 | -------------------------------------------------------------------------------- /kork-crypto/src/main/java/com/netflix/spinnaker/kork/crypto/NestedSecurityIOException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.crypto; 18 | 19 | import java.security.GeneralSecurityException; 20 | import org.springframework.core.NestedIOException; 21 | 22 | public class NestedSecurityIOException extends NestedIOException { 23 | public NestedSecurityIOException(GeneralSecurityException e) { 24 | super(e.getMessage(), e); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /kork-crypto/src/main/java/com/netflix/spinnaker/kork/crypto/NestedSecurityRuntimeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.crypto; 18 | 19 | import java.security.GeneralSecurityException; 20 | import org.springframework.core.NestedRuntimeException; 21 | 22 | public class NestedSecurityRuntimeException extends NestedRuntimeException { 23 | public NestedSecurityRuntimeException(GeneralSecurityException e) { 24 | super(e.getMessage(), e); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /kork-crypto/src/main/java/com/netflix/spinnaker/kork/crypto/PasswordProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.crypto; 18 | 19 | import java.io.IOException; 20 | import java.security.GeneralSecurityException; 21 | 22 | /** Function for providing a password for use with decrypting keystores. */ 23 | @FunctionalInterface 24 | public interface PasswordProvider { 25 | char[] password() throws IOException, GeneralSecurityException; 26 | } 27 | -------------------------------------------------------------------------------- /kork-crypto/src/main/java/com/netflix/spinnaker/kork/crypto/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @NonnullByDefault 18 | package com.netflix.spinnaker.kork.crypto; 19 | 20 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 21 | -------------------------------------------------------------------------------- /kork-eureka/README.md: -------------------------------------------------------------------------------- 1 | # kork-eureka 2 | 3 | Contains all code for Spinnaker's integration with Eureka for service discovery. 4 | 5 | To enable: 6 | 7 | ```yaml 8 | archaius.enabled=true 9 | eureka.enabled=true 10 | ``` 11 | -------------------------------------------------------------------------------- /kork-eureka/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kork-eureka/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.kork.archaius.ArchaiusAutoConfiguration 2 | com.netflix.spinnaker.kork.eureka.EurekaAutoConfiguration 3 | -------------------------------------------------------------------------------- /kork-exceptions/kork-exceptions.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply plugin: "groovy" 3 | apply from: "$rootDir/gradle/lombok.gradle" 4 | 5 | dependencies { 6 | api(platform(project(":spinnaker-dependencies"))) 7 | api "com.google.code.findbugs:jsr305" 8 | 9 | testImplementation "org.mockito:mockito-core" 10 | testImplementation "org.junit.jupiter:junit-jupiter-api" 11 | testImplementation "org.junit.jupiter:junit-jupiter-params" 12 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" 13 | 14 | testImplementation "com.hubspot.jinjava:jinjava" 15 | } 16 | -------------------------------------------------------------------------------- /kork-exceptions/src/main/java/com/netflix/spinnaker/kork/exceptions/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.exceptions; 17 | 18 | /** An exception thrown when the cause is a misconfiguration */ 19 | public class ConfigurationException extends UserException { 20 | public ConfigurationException(String message) { 21 | super(message); 22 | } 23 | 24 | public ConfigurationException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /kork-exceptions/src/main/java/com/netflix/spinnaker/kork/exceptions/CredentialsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.kork.exceptions; 19 | 20 | /** Exception related to Credentials management */ 21 | public abstract class CredentialsException extends SpinnakerException { 22 | public CredentialsException() {} 23 | 24 | public CredentialsException(String message) { 25 | super(message); 26 | } 27 | 28 | public CredentialsException(String message, Throwable cause) { 29 | super(message, cause); 30 | } 31 | 32 | public CredentialsException(Throwable cause) { 33 | super(cause); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /kork-exceptions/src/main/java/com/netflix/spinnaker/kork/exceptions/HasAdditionalAttributes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.exceptions; 18 | 19 | import java.util.Collections; 20 | import java.util.Map; 21 | 22 | /** Provides a standard way of attaching untyped, arbitrary metadata to an Exception. */ 23 | public interface HasAdditionalAttributes { 24 | default Map getAdditionalAttributes() { 25 | return Collections.emptyMap(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /kork-exceptions/src/main/java/com/netflix/spinnaker/kork/exceptions/InvalidCredentialsTypeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.kork.exceptions; 19 | 20 | public class InvalidCredentialsTypeException extends CredentialsException { 21 | 22 | public InvalidCredentialsTypeException() {} 23 | 24 | public InvalidCredentialsTypeException(String message) { 25 | super(message); 26 | } 27 | 28 | public InvalidCredentialsTypeException(String message, Throwable cause) { 29 | super(message, cause); 30 | } 31 | 32 | public InvalidCredentialsTypeException(Throwable cause) { 33 | super(cause); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /kork-exceptions/src/main/java/com/netflix/spinnaker/kork/exceptions/MissingCredentialsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.kork.exceptions; 19 | 20 | public class MissingCredentialsException extends CredentialsException { 21 | 22 | public MissingCredentialsException() {} 23 | 24 | public MissingCredentialsException(String message) { 25 | super(message); 26 | } 27 | 28 | public MissingCredentialsException(String message, Throwable cause) { 29 | super(message, cause); 30 | } 31 | 32 | public MissingCredentialsException(Throwable cause) { 33 | super(cause); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /kork-exceptions/src/main/java/com/netflix/spinnaker/kork/exceptions/UnknownCredentialsTypeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.kork.exceptions; 19 | 20 | public class UnknownCredentialsTypeException extends CredentialsException { 21 | public UnknownCredentialsTypeException() {} 22 | 23 | public UnknownCredentialsTypeException(String message) { 24 | super(message); 25 | } 26 | 27 | public UnknownCredentialsTypeException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | public UnknownCredentialsTypeException(Throwable cause) { 32 | super(cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /kork-expressions/kork-expressions.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/lombok.gradle" 3 | apply from: "$rootDir/gradle/kotlin.gradle" 4 | 5 | dependencies { 6 | api(platform(project(":spinnaker-dependencies"))) 7 | 8 | api project(":kork-api") 9 | api project(":kork-artifacts") 10 | api project(":kork-plugins-api") 11 | api project(":kork-exceptions") 12 | api "com.fasterxml.jackson.core:jackson-databind" 13 | api "org.springframework:spring-context" 14 | api "org.slf4j:slf4j-api" 15 | 16 | implementation "org.springframework.boot:spring-boot" 17 | 18 | testImplementation project(":kork-artifacts") 19 | testImplementation "org.assertj:assertj-core" 20 | testImplementation "org.junit.jupiter:junit-jupiter-api" 21 | testImplementation "org.junit.jupiter:junit-jupiter-params" 22 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" 23 | testRuntimeOnly "org.slf4j:slf4j-simple" 24 | } 25 | 26 | detekt { 27 | ignoreFailures = false 28 | } 29 | -------------------------------------------------------------------------------- /kork-expressions/src/main/java/com/netflix/spinnaker/kork/expressions/SpelHelperFunctionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.expressions; 18 | 19 | import com.netflix.spinnaker.kork.exceptions.SpinnakerException; 20 | 21 | public class SpelHelperFunctionException extends SpinnakerException { 22 | public SpelHelperFunctionException(String message) { 23 | super(message); 24 | } 25 | 26 | public SpelHelperFunctionException(String message, Throwable cause) { 27 | super(message, cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kork-expressions/src/main/kotlin/com/netflix/spinnaker/kork/expressions/ExpressionFunctionProvider.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package com.netflix.spinnaker.kork.expressions 18 | 19 | import com.netflix.spinnaker.kork.api.expressions.ExpressionFunctionProvider 20 | 21 | /** 22 | * Backwards-compatibility interface: [ExpressionFunctionProvider] was not originally exposed 23 | * as an extension point. This class can be removed once services have updated their dependencies. 24 | */ 25 | @Deprecated("Interface has been moved to kork-api with a new package") 26 | interface ExpressionFunctionProvider : ExpressionFunctionProvider 27 | -------------------------------------------------------------------------------- /kork-jedis-test/kork-jedis-test.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | 3 | dependencies { 4 | api(platform(project(":spinnaker-dependencies"))) 5 | 6 | api "redis.clients:jedis" 7 | implementation "org.testcontainers:testcontainers" 8 | } 9 | -------------------------------------------------------------------------------- /kork-jedis/kork-jedis.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply plugin: "groovy" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | 7 | api "org.springframework.boot:spring-boot-starter-actuator" 8 | api "redis.clients:jedis" 9 | api project(":kork-core") 10 | api "com.netflix.spectator:spectator-api" 11 | 12 | implementation "com.fasterxml.jackson.core:jackson-databind" 13 | implementation "org.apache.commons:commons-lang3" 14 | 15 | testImplementation "com.hubspot.jinjava:jinjava" 16 | testImplementation project(":kork-core-tck") 17 | testImplementation project(":kork-jedis-test") 18 | testImplementation "org.mockito:mockito-core" 19 | testImplementation "org.spockframework:spock-core" 20 | testImplementation "org.junit.jupiter:junit-jupiter-api" 21 | testRuntimeOnly "cglib:cglib-nodep" 22 | testRuntimeOnly "org.objenesis:objenesis" 23 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" 24 | } 25 | -------------------------------------------------------------------------------- /kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisDriverProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.jedis; 17 | 18 | import org.apache.commons.pool2.impl.GenericObjectPoolConfig; 19 | 20 | public class JedisDriverProperties { 21 | 22 | /** The redis connection uri: (e.g. redis://localhost:6379) */ 23 | public String connection; 24 | 25 | /** Client connection timeout. (Not to be confused with command timeout). */ 26 | public int timeoutMs = 2000; 27 | 28 | /** 29 | * Redis object pool configuration. 30 | * 31 | *

If left null, the default object pool as defined in {@code JedisClientConfiguration} will be 32 | * used. 33 | */ 34 | public GenericObjectPoolConfig poolConfig; 35 | } 36 | -------------------------------------------------------------------------------- /kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegateFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.jedis; 17 | 18 | import com.netflix.spinnaker.kork.jedis.RedisClientConfiguration.Driver; 19 | import java.util.Map; 20 | 21 | public interface RedisClientDelegateFactory { 22 | 23 | boolean supports(Driver driver); 24 | 25 | C build(String name, Map properties); 26 | } 27 | -------------------------------------------------------------------------------- /kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisScanResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.jedis; 17 | 18 | import java.util.List; 19 | 20 | public interface RedisScanResult { 21 | 22 | List getResults(); 23 | } 24 | -------------------------------------------------------------------------------- /kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/exception/ConflictingConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.jedis.exception; 17 | 18 | public class ConflictingConfiguration extends IllegalStateException { 19 | public ConflictingConfiguration(String s) { 20 | super(s); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/exception/MissingRequiredConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.jedis.exception; 17 | 18 | public class MissingRequiredConfiguration extends IllegalStateException { 19 | public MissingRequiredConfiguration(String configuration) { 20 | super("Missing required Jedis client configuration '" + configuration + "'"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/exception/RedisClientFactoryNotFound.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.jedis.exception; 17 | 18 | public class RedisClientFactoryNotFound extends IllegalStateException { 19 | 20 | public RedisClientFactoryNotFound(String s) { 21 | super(s); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/exception/RedisClientNotFound.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.jedis.exception; 17 | 18 | public class RedisClientNotFound extends RuntimeException { 19 | 20 | public RedisClientNotFound(String message) { 21 | super(message); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedisException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.jedis.telemetry; 17 | 18 | import redis.clients.jedis.exceptions.JedisException; 19 | 20 | class InstrumentedJedisException extends JedisException { 21 | public InstrumentedJedisException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /kork-moniker/kork-moniker.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | apply plugin:"groovy" 17 | 18 | dependencies { 19 | api(platform(project(":spinnaker-dependencies"))) 20 | 21 | compileOnly "org.projectlombok:lombok" 22 | annotationProcessor "org.projectlombok:lombok" 23 | implementation "com.netflix.frigga:frigga" 24 | 25 | testImplementation "org.spockframework:spock-core" 26 | testImplementation "org.junit.jupiter:junit-jupiter-api" 27 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" 28 | } 29 | -------------------------------------------------------------------------------- /kork-moniker/src/main/java/com/netflix/spinnaker/moniker/Moniker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.moniker; 18 | 19 | import lombok.AllArgsConstructor; 20 | import lombok.Builder; 21 | import lombok.Data; 22 | import lombok.NoArgsConstructor; 23 | 24 | @Data 25 | @Builder 26 | @NoArgsConstructor 27 | @AllArgsConstructor 28 | public class Moniker { 29 | String app; 30 | String cluster; 31 | String detail; 32 | String stack; 33 | Integer sequence; 34 | } 35 | -------------------------------------------------------------------------------- /kork-moniker/src/main/java/com/netflix/spinnaker/orchestration/OperationDescription.java: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.orchestration; 2 | 3 | /** Marker interface for inputs to an AtomicOperation. */ 4 | public interface OperationDescription {} 5 | -------------------------------------------------------------------------------- /kork-plugins-api/kork-plugins-api.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | apply plugin: "java-library" 18 | apply from: "$rootDir/gradle/kotlin-test.gradle" 19 | 20 | dependencies { 21 | api(platform(project(":spinnaker-dependencies"))) 22 | 23 | api "org.slf4j:slf4j-api" 24 | api "javax.annotation:javax.annotation-api" 25 | api project(":kork-annotations") 26 | api "org.pf4j:pf4j" 27 | 28 | testImplementation(project(":kork-plugins")) 29 | } 30 | -------------------------------------------------------------------------------- /kork-plugins-api/src/main/java/com/netflix/spinnaker/kork/plugins/api/PluginComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.api; 17 | 18 | import com.netflix.spinnaker.kork.annotations.Beta; 19 | import java.lang.annotation.*; 20 | 21 | /** Marks a class within a plugin as one that is candidate for dependency injection. */ 22 | @Beta 23 | @Retention(RetentionPolicy.RUNTIME) 24 | @Target(ElementType.TYPE) 25 | @Documented 26 | public @interface PluginComponent { 27 | String value() default ""; 28 | } 29 | -------------------------------------------------------------------------------- /kork-plugins-api/src/main/java/com/netflix/spinnaker/kork/plugins/api/events/Async.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package com.netflix.spinnaker.kork.plugins.api.events; 18 | 19 | import com.netflix.spinnaker.kork.annotations.Beta; 20 | import java.lang.annotation.*; 21 | 22 | /** Used to mark a {@link SpinnakerEventListener} as asynchronous. */ 23 | @Beta 24 | @Retention(RetentionPolicy.RUNTIME) 25 | @Target(ElementType.TYPE) 26 | @Documented 27 | public @interface Async {} 28 | -------------------------------------------------------------------------------- /kork-plugins-api/src/main/java/com/netflix/spinnaker/kork/plugins/api/internal/ExtensionInvocationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.kork.plugins.api.internal; 19 | 20 | import java.lang.reflect.InvocationHandler; 21 | 22 | /** 23 | * When proxying an extension class, implement this interface to provide a mechanism to obtain the 24 | * underlying proxied class. 25 | */ 26 | public interface ExtensionInvocationHandler extends InvocationHandler { 27 | 28 | /** Get the proxy target class. */ 29 | Class getTargetClass(); 30 | 31 | /** Get the plugin ID of the proxied extension point. */ 32 | String getPluginId(); 33 | } 34 | -------------------------------------------------------------------------------- /kork-plugins-api/src/main/java/com/netflix/spinnaker/kork/plugins/api/servicesdk/EmptyServiceSdk.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.api.servicesdk; 17 | 18 | /** 19 | * If a service does not provide its own {@link ServiceSdk}, this empty class will be provided in 20 | * return. 21 | */ 22 | public class EmptyServiceSdk implements ServiceSdk {} 23 | -------------------------------------------------------------------------------- /kork-plugins-api/src/main/java/com/netflix/spinnaker/kork/plugins/api/servicesdk/ServiceSdk.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.api.servicesdk; 17 | 18 | /** 19 | * Marker interface for service-specific SDKs. 20 | * 21 | *

A service may expose additional SDKs that are specific to itself. 22 | */ 23 | public interface ServiceSdk {} 24 | -------------------------------------------------------------------------------- /kork-plugins-spring-api/kork-plugins-spring-api.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | apply plugin: "java-library" 18 | apply from: "${project.rootDir}/gradle/kotlin-test.gradle" 19 | 20 | dependencies { 21 | api(platform(project(":spinnaker-dependencies"))) 22 | 23 | api project(":kork-plugins-api") 24 | api "org.springframework.boot:spring-boot-starter-web" 25 | api "org.springframework.boot:spring-boot-actuator" 26 | 27 | testImplementation "org.springframework.boot:spring-boot-starter-test" 28 | } 29 | -------------------------------------------------------------------------------- /kork-plugins-spring-api/src/main/java/com/netflix/spinnaker/kork/plugins/api/spring/BeanPromoter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.plugins.api.spring; 18 | 19 | public interface BeanPromoter { 20 | void promote(String beanName, Object bean, Class beanClass, boolean isPrimary); 21 | } 22 | -------------------------------------------------------------------------------- /kork-plugins-spring-api/src/main/java/com/netflix/spinnaker/kork/plugins/api/spring/ExposeToApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.plugins.api.spring; 18 | 19 | import java.lang.annotation.*; 20 | 21 | /** Indicates that a plugin bean should be elevated to the application's context. */ 22 | @Target({ElementType.TYPE, ElementType.METHOD}) 23 | @Retention(RetentionPolicy.RUNTIME) 24 | @Documented 25 | public @interface ExposeToApp {} 26 | -------------------------------------------------------------------------------- /kork-plugins-spring-api/src/test/kotlin/com/netflix/spinnaker/kork/plugins/api/spring/TestPrivilegedSpringPlugin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.plugins.api.spring 18 | 19 | import org.pf4j.PluginWrapper 20 | import org.springframework.beans.factory.support.BeanDefinitionRegistry 21 | 22 | internal class TestPrivilegedSpringPlugin(wrapper: PluginWrapper) : PrivilegedSpringPlugin(wrapper) { 23 | 24 | override fun registerBeanDefinitions(registry: BeanDefinitionRegistry) { 25 | registerBean(primaryBeanDefinitionFor(MyService::class.java), registry) 26 | } 27 | 28 | internal class MyService 29 | } 30 | -------------------------------------------------------------------------------- /kork-plugins-spring-api/src/test/kotlin/com/netflix/spinnaker/kork/plugins/api/spring/TestSpringLoaderPlugin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Armory, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.plugins.api.spring 18 | 19 | import org.pf4j.PluginWrapper 20 | 21 | internal class TestSpringLoaderPlugin(wrapper: PluginWrapper) : SpringLoaderPlugin(wrapper) { 22 | 23 | 24 | override fun getPackagesToScan(): List? { 25 | return listOf("io.armory.plugin.example.spring") 26 | } 27 | 28 | override fun getClassesToRegister(): List?>? { 29 | return listOf(MyService::class.java) 30 | } 31 | 32 | internal class MyService 33 | } 34 | -------------------------------------------------------------------------------- /kork-plugins-tck/README.md: -------------------------------------------------------------------------------- 1 | # kork-plugins-tck 2 | 3 | This can be used to build JAR or Zip plugins for testing plugin and extension 4 | point integration in services. It also provides a standard set of tests that will run when tests 5 | extend [PluginsTck](/src/main/kotlin/com/netflix/spinnaker/kork/plugins/tck/PluginsTck.kt) and 6 | implement the [PluginsTckFixture](/src/main/kotlin/com/netflix/spinnaker/kork/plugins/tck/PluginsTckFixture.kt) 7 | 8 | For example, see this implementation in Orca: 9 | 10 | https://github.com/spinnaker/orca/tree/master/orca-plugins-test 11 | -------------------------------------------------------------------------------- /kork-plugins-tck/kork-plugins-tck.gradle: -------------------------------------------------------------------------------- 1 | apply from: "$rootDir/gradle/kotlin.gradle" 2 | apply from: "$rootDir/gradle/lombok.gradle" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | 7 | implementation project(":kork-plugins") 8 | implementation project(":kork-plugins-api") 9 | implementation "org.pf4j:pf4j" 10 | 11 | //Test framework dependencies 12 | api("io.strikt:strikt-jvm") 13 | api("dev.minutest:minutest") 14 | api("io.mockk:mockk") 15 | api("org.springframework.boot:spring-boot-starter-test") 16 | api("org.springframework.security:spring-security-test") 17 | api("org.springframework.security:spring-security-config") 18 | api("com.ninja-squad:springmockk") 19 | 20 | testRuntimeOnly "cglib:cglib-nodep" 21 | testRuntimeOnly "org.objenesis:objenesis" 22 | testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") 23 | } 24 | 25 | detekt { 26 | ignoreFailures = false 27 | } 28 | -------------------------------------------------------------------------------- /kork-plugins-tck/src/main/kotlin/com/netflix/spinnaker/kork/plugins/testplugin/api/TestExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.testplugin.api 17 | 18 | import com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint 19 | 20 | /** A simple ExtensionPoint for unit/integration testing. */ 21 | interface TestExtension : SpinnakerExtensionPoint { 22 | /** 23 | * An arbitrary test property. 24 | */ 25 | val testValue: String 26 | } 27 | -------------------------------------------------------------------------------- /kork-plugins-tck/src/test/kotlin/com/spinnaker/netflix/kork/plugins/plugin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.spinnaker.netflix.kork.plugins 18 | 19 | import com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint 20 | import org.pf4j.Extension 21 | import org.pf4j.Plugin 22 | import org.pf4j.PluginWrapper 23 | 24 | class TestPlugin(pluginWrapper: PluginWrapper?) : Plugin(pluginWrapper) 25 | 26 | @Extension 27 | class SomeFeatureExtension : SomeFeature 28 | 29 | interface SomeFeature : SpinnakerExtensionPoint 30 | -------------------------------------------------------------------------------- /kork-plugins/README.md: -------------------------------------------------------------------------------- 1 | # kork-plugins 2 | 3 | TODO. Where to even begin? 4 | 5 | - How plugins are loaded 6 | - How versions are resolved 7 | - How plugin extensions are promoted 8 | - Basics of PF4J (class loaders, etc) 9 | - UpdateRepository schema 10 | - Value of front50 as an update repository 11 | - SDKs 12 | - Configs 13 | - Remote extensions 14 | - Events 15 | - Finders & PluginRef 16 | - ...etc? 17 | 18 | ![v2-plugin-framework-sequence](v2-plugin-framework.png) 19 | 20 | https://app.lucidchart.com/invitations/accept/1883724f-f061-451a-8a64-05165b952d96 21 | -------------------------------------------------------------------------------- /kork-plugins/src/main/java/com/netflix/spinnaker/config/SerdeSdkConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.config; 17 | 18 | import com.netflix.spinnaker.kork.plugins.sdk.SdkFactory; 19 | import com.netflix.spinnaker.kork.plugins.sdk.serde.SerdeServiceSdkFactory; 20 | import org.springframework.context.ApplicationContext; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | 24 | @Configuration 25 | public class SerdeSdkConfiguration { 26 | 27 | @Bean 28 | public static SdkFactory serdeServiceSdkFactory(ApplicationContext applicationContext) { 29 | return new SerdeServiceSdkFactory(applicationContext); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kork-plugins/src/main/java/com/netflix/spinnaker/config/YamlResourceLoaderSdkConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.config; 18 | 19 | import com.netflix.spinnaker.kork.plugins.sdk.SdkFactory; 20 | import com.netflix.spinnaker.kork.plugins.sdk.yaml.YamlResourceLoaderSdkFactory; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | 24 | @Configuration 25 | public class YamlResourceLoaderSdkConfiguration { 26 | 27 | @Bean 28 | public static SdkFactory yamlResourceLoaderSdkFactory() { 29 | return new YamlResourceLoaderSdkFactory(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/config/Configurable.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.config 17 | 18 | import kotlin.reflect.KClass 19 | 20 | /** 21 | * Marks a class as configurable, allowing the results of a [ConfigResolver] to be injected into a 22 | * class as a constructor argument. 23 | * 24 | * @param value The configuration class. 25 | */ 26 | @Target(AnnotationTarget.CLASS) 27 | @Retention(AnnotationRetention.RUNTIME) 28 | @MustBeDocumented 29 | annotation class Configurable( 30 | val value: KClass<*> 31 | ) 32 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/events/ExtensionCreated.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package com.netflix.spinnaker.kork.plugins.events 18 | 19 | import org.springframework.context.ApplicationEvent 20 | 21 | /** 22 | * Emitted whenever an extension is created and injected into the service application context. 23 | * 24 | * @param source The object that created the event 25 | * @param beanName The name of the extension bean in Spring's context 26 | * @param bean The extension object itself 27 | * @param beanClass The extension class 28 | */ 29 | class ExtensionCreated( 30 | source: Any, 31 | val beanName: String, 32 | val bean: Any, 33 | val beanClass: Class<*> 34 | ) : ApplicationEvent(source) 35 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/events/RemotePluginCacheRefresh.kt: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.plugins.events 2 | 3 | import com.netflix.spinnaker.kork.plugins.remote.RemotePluginsCache 4 | import org.springframework.context.ApplicationEvent 5 | 6 | /** 7 | * A Spring [ApplicationEvent] that is emitted when the remote plugins cache is changed. 8 | * 9 | * The remote plugins cache is the cache of resolved remote plugins with remote transport 10 | * clients. This can optionally be used in Spinnaker services to ensure a remote 11 | * extension point implementation has the latest cached version of the remote plugin. 12 | * 13 | * @param source The source of the event 14 | * @param pluginId The plugin ID that triggered this cache refresh event 15 | */ 16 | data class RemotePluginCacheRefresh( 17 | private val source: RemotePluginsCache, 18 | val pluginId: String 19 | ) : ApplicationEvent(source) 20 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/package.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins 17 | 18 | /** 19 | * Plugin Framework V1 config value. 20 | */ 21 | const val FRAMEWORK_V1 = "v1" 22 | 23 | /** 24 | * Plugin Framework V2 config value. 25 | */ 26 | const val FRAMEWORK_V2 = "v2" 27 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/remote/RemotePlugin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.kork.plugins.remote 19 | 20 | import com.netflix.spinnaker.kork.annotations.Beta 21 | import com.netflix.spinnaker.kork.plugins.remote.extension.RemoteExtension 22 | 23 | /** 24 | * The root class of a remote plugin model. 25 | * 26 | * @param id The canonical plugin ID. See [CanonicalPluginId]. 27 | * @param version The version of the plugin. 28 | * @param remoteExtensions The list of remote extensions associated with this plugin. 29 | */ 30 | @Beta 31 | data class RemotePlugin( 32 | val id: String, 33 | val version: String, 34 | val remoteExtensions: Set 35 | ) 36 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/remote/extension/RemoteExtensionPointConfig.kt: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.plugins.remote.extension 2 | 3 | /** 4 | * Root type of remote extension point configurations, implemented in Spinnaker services. 5 | */ 6 | interface RemoteExtensionPointConfig 7 | 8 | /** 9 | * No-op in the case wherein a remote extension does not have any necessary configuration. 10 | * 11 | * @param type The type of remote extension, defaults to "noop" 12 | */ 13 | data class NoOpRemoteExtensionPointConfig(val type: String = "noop"): RemoteExtensionPointConfig 14 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/remote/extension/RemoteExtensionPointDefinition.kt: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.plugins.remote.extension 2 | 3 | /** 4 | * Define properties of the remote extension. Spinnaker services must implement this and provide it 5 | * as a Spring bean in order for remote plugin extensions to be resolved from the configuration. 6 | */ 7 | interface RemoteExtensionPointDefinition { 8 | 9 | /** 10 | * The remote extension type. 11 | */ 12 | fun type(): String 13 | 14 | /** 15 | * The remote extension configuration type. 16 | */ 17 | fun configType(): Class = NoOpRemoteExtensionPointConfig::class.java 18 | } 19 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/remote/extension/transport/RemoteExtensionPayload.kt: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.plugins.remote.extension.transport 2 | 3 | import com.netflix.spinnaker.kork.annotations.Beta 4 | 5 | /** 6 | * Marker interface for the payload for the remote extension - implemented at various extension 7 | * points throughout the services. 8 | */ 9 | @Beta 10 | interface RemoteExtensionPayload 11 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/remote/extension/transport/RemoteExtensionQuery.kt: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.plugins.remote.extension.transport 2 | 3 | import com.netflix.spinnaker.kork.annotations.Beta 4 | 5 | /** 6 | * Query to use when reading from a remote extension. Mapped to the corresponding transport 7 | * mechanism for performing a remote extension read. 8 | */ 9 | @Beta 10 | interface RemoteExtensionQuery 11 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/remote/extension/transport/RemoteExtensionResponse.kt: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.plugins.remote.extension.transport 2 | 3 | import com.fasterxml.jackson.annotation.JsonTypeInfo 4 | import com.fasterxml.jackson.annotation.JsonTypeName 5 | import com.netflix.spinnaker.kork.annotations.Beta 6 | 7 | /** 8 | * Response for synchronous process of writing or reading from a remote extension. 9 | */ 10 | @Beta 11 | @JsonTypeInfo( 12 | use = JsonTypeInfo.Id.NAME, 13 | include = JsonTypeInfo.As.PROPERTY, 14 | property = "type" 15 | ) 16 | interface RemoteExtensionResponse 17 | 18 | /** 19 | * Default no-op response such that implementing [RemoteExtensionTransport.read] and [RemoteExtensionTransport.write] 20 | * are optional. 21 | */ 22 | @JsonTypeName("noOpResponse") 23 | class NoOpRemoteExtensionResponse : RemoteExtensionResponse 24 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/sdk/SdkFactory.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.sdk 17 | 18 | import org.pf4j.PluginWrapper 19 | 20 | /** 21 | * A Plugin SDK factory, responsible for initializing and configuring SDKs 22 | * according to an extension and/or plugin configurations. 23 | */ 24 | interface SdkFactory { 25 | 26 | /** 27 | * Create the SDK for the provided [pluginClass] and [pluginWrapper]. 28 | * 29 | * TODO(rz): pluginWrapper should never be null. Investigate. 30 | * 31 | * @param pluginClass Any class inside of a plugin. 32 | */ 33 | fun create(pluginClass: Class<*>, pluginWrapper: PluginWrapper?): Any 34 | } 35 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/sdk/yaml/YamlResourceLoaderSdkFactory.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.plugins.sdk.yaml 18 | 19 | import com.netflix.spinnaker.kork.plugins.sdk.SdkFactory 20 | import org.pf4j.Plugin 21 | import org.pf4j.PluginWrapper 22 | 23 | /** 24 | * Creates YAML Resource Loader for the provided extension class. 25 | */ 26 | class YamlResourceLoaderSdkFactory : SdkFactory { 27 | 28 | override fun create(pluginClass: Class<*>, pluginWrapper: PluginWrapper?): Any = 29 | JacksonYamlResourceLoader(pluginClass) 30 | } 31 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/update/ServerGroupLocationResolver.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.update 17 | 18 | import java.util.function.Supplier 19 | 20 | /** 21 | * Contract to resolve the server group location (region, datacenter...) of the running service. 22 | * 23 | * Null will be returned if no location can be resolved. 24 | */ 25 | interface ServerGroupLocationResolver : Supplier 26 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/update/ServerGroupNameResolver.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.update 17 | 18 | import java.util.function.Supplier 19 | 20 | /** 21 | * Contract to resolve the server group name of the running service. 22 | * 23 | * If the running service is clouddriver, the resulting value may be `clouddriver-main-v123`. Null will be returned 24 | * if no server group name can be resolved. 25 | */ 26 | interface ServerGroupNameResolver : Supplier 27 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/update/downloader/ProcessFileDownloaderConfig.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.update.downloader 17 | 18 | /** 19 | * Configuration for the [ProcessFileDownloader]. 20 | * 21 | * @param command The process command, as well as all arguments for the command. 22 | * @param env Any environment variables for the process. 23 | */ 24 | data class ProcessFileDownloaderConfig( 25 | val command: String, 26 | val env: Map = mapOf() 27 | ) 28 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/update/internal/PluginOkHttpClientProvider.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.update.internal 17 | 18 | import okhttp3.OkHttpClient 19 | 20 | /** 21 | * Provider class for [OkHttpClient] to use in the plugin framework. 22 | * 23 | * We need to share an OkHttpClient around the plugin framework codebase, but we don't want to wire up an OkHttpClient 24 | * Bean, since we would risk changing existing service configuration behavior. This class just wraps a single 25 | * configured instance of OkHttpClient. 26 | * 27 | * @param okHttpClient The proxied [OkHttpClient]. 28 | */ 29 | class PluginOkHttpClientProvider( 30 | val okHttpClient: OkHttpClient 31 | ) 32 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/update/release/PluginInfoRelease.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.plugins.update.release 18 | 19 | import com.netflix.spinnaker.kork.plugins.update.internal.SpinnakerPluginInfo 20 | 21 | /** 22 | * A tuple of [pluginId] and [SpinnakerPluginInfo.SpinnakerPluginRelease] 23 | * 24 | * @param pluginId The plugin ID 25 | * @param props A [SpinnakerPluginInfo.SpinnakerPluginRelease] for the given [pluginId] 26 | */ 27 | data class PluginInfoRelease(val pluginId: String, var props: SpinnakerPluginInfo.SpinnakerPluginRelease) 28 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/v2/ApplicationContextGraph.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.v2 17 | 18 | import org.springframework.context.ApplicationContext 19 | import org.springframework.context.ConfigurableApplicationContext 20 | 21 | /** 22 | * For testing purposes only. Spring doesn't have a way to find child contexts from a parent. 23 | */ 24 | internal object ApplicationContextGraph { 25 | lateinit var serviceApplicationContext: ConfigurableApplicationContext 26 | val pluginContexts: MutableMap = mutableMapOf() 27 | 28 | fun pluginContext(pluginId: String): ConfigurableApplicationContext? = 29 | pluginContexts[pluginId] 30 | } 31 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/v2/context/PluginApplicationContextCustomizer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package com.netflix.spinnaker.kork.plugins.v2.context 18 | 19 | import org.pf4j.Plugin 20 | import org.springframework.context.ConfigurableApplicationContext 21 | import java.util.function.BiConsumer 22 | 23 | /** 24 | * Provides an extension point for modifying a Plugin's ApplicationContext prior to it being 25 | * refreshed (initialized). 26 | */ 27 | interface PluginApplicationContextCustomizer : BiConsumer 28 | -------------------------------------------------------------------------------- /kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/v2/dsl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package com.netflix.spinnaker.kork.plugins.v2 18 | 19 | import org.pf4j.Plugin 20 | 21 | /** 22 | * Get the base package name of a [Plugin]. 23 | */ 24 | internal val Plugin.basePackageName: String 25 | get() = javaClass.`package`.name 26 | -------------------------------------------------------------------------------- /kork-plugins/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spinnaker/kork/a7b6fdea15ec2e98c80093947f194afb0ee552f3/kork-plugins/src/main/resources/META-INF/spring.factories -------------------------------------------------------------------------------- /kork-plugins/src/test/java/com/netflix/spinnaker/kork/plugins/testplugin/unsafe/UnsafeTestExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.plugins.testplugin.unsafe; 18 | 19 | import com.netflix.spinnaker.kork.plugins.testplugin.api.TestExtension; 20 | import org.pf4j.Extension; 21 | 22 | /** An unsafe (in codebase) implementation of TestExtension. */ 23 | @Extension 24 | public class UnsafeTestExtension implements TestExtension { 25 | @Override 26 | public String getTestValue() { 27 | return getClass().getSimpleName(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kork-plugins/src/test/java/com/netflix/spinnaker/kork/plugins/testplugin/unsafe/UnsafeTestPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.plugins.testplugin.unsafe; 18 | 19 | import org.pf4j.Plugin; 20 | import org.pf4j.PluginWrapper; 21 | 22 | /** An unsafe (in-codebase) Plugin for UnsafeTestExtension. */ 23 | public class UnsafeTestPlugin extends Plugin { 24 | public UnsafeTestPlugin(PluginWrapper wrapper) { 25 | super(wrapper); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /kork-plugins/src/test/kotlin/com/netflix/spinnaker/kork/plugins/finders/types.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.finders 17 | 18 | import org.pf4j.DefaultPluginDescriptor 19 | import org.pf4j.Plugin 20 | 21 | internal val pluginDescriptor = DefaultPluginDescriptor( 22 | "netflix/sentient-robot", 23 | "You pass the butter", 24 | Plugin::class.java.name, 25 | "0.0.1", 26 | "*", 27 | "Netflix", 28 | "Apache 2.0" 29 | ) 30 | -------------------------------------------------------------------------------- /kork-plugins/src/test/kotlin/com/netflix/spinnaker/kork/plugins/internal/TestPlugin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.internal 17 | 18 | import org.pf4j.Plugin 19 | import org.pf4j.PluginWrapper 20 | 21 | class TestPlugin(wrapper: PluginWrapper) : Plugin(wrapper) 22 | -------------------------------------------------------------------------------- /kork-plugins/src/test/kotlin/com/netflix/spinnaker/kork/plugins/v2/scenarios/fixtures/ParentServiceBean.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.plugins.v2.scenarios.fixtures 17 | 18 | import org.springframework.beans.factory.annotation.Value 19 | import org.springframework.stereotype.Component 20 | 21 | @Component("parentServiceBean") 22 | class ParentServiceBean(@Value("\${someKey}") val someKey: String) 23 | -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/bundle/deck/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/bundle/orca/hello.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spinnaker/kork/a7b6fdea15ec2e98c80093947f194afb0ee552f3/kork-plugins/src/test/resources/bundle/orca/hello.txt -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/descriptor.mf: -------------------------------------------------------------------------------- 1 | Plugin-Id: netflix/sentient-robot 2 | Plugin-Description: You pass the butter 3 | Plugin-Class: org.pf4j.Plugin 4 | Plugin-Version: 0.0.1 5 | Plugin-Provider: Netflix 6 | Plugin-Requires: * 7 | Plugin-License: Apache 2.0 8 | Plugin-Unsafe: true 9 | Plugin-Namespace: pf4j 10 | -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/descriptor.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2019 Netflix, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | plugin.id=netflix/sentient-robot 17 | plugin.description=You pass the butter 18 | plugin.class=org.pf4j.Plugin 19 | plugin.version=0.0.1 20 | plugin.provider=Netflix 21 | plugin.dependencies= 22 | plugin.requires=* 23 | plugin.license=Apache 2.0 24 | plugin.unsafe=true 25 | plugin.namespace=pf4j 26 | -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/test.plugin-ref: -------------------------------------------------------------------------------- 1 | { 2 | "pluginPath": "testplugin", 3 | "classesDirs": [], 4 | "libsDirs": [] 5 | } 6 | -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/testplugin/plugin-empty-config.yml: -------------------------------------------------------------------------------- 1 | spinnaker: 2 | extensibility: 3 | repositories: {} 4 | -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/testplugin/plugin.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2019 Netflix, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | plugin.id=spinnaker.testplugin 17 | plugin.description=No You pass the butter 18 | plugin.class=org.pf4j.Plugin 19 | plugin.version=0.0.1 20 | plugin.provider=Netflix 21 | plugin.dependencies= 22 | plugin.requires=* 23 | plugin.license=Apache 2.0 24 | plugin.unsafe=false 25 | -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/unsafe-testplugin/plugin.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2019 Netflix, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | plugin.id=spinnaker.unsafetestplugin 17 | plugin.description=An unsafe test Plugin 18 | plugin.class=com.netflix.spinnaker.kork.plugins.testplugin.unsafe.UnsafeTestPlugin 19 | plugin.version=0.0.1 20 | plugin.provider=Spinnaker 21 | plugin.dependencies= 22 | plugin.requires=* 23 | plugin.license=Apache 2.0 24 | plugin.unsafe=true 25 | -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/yaml/sampleobject.yml: -------------------------------------------------------------------------------- 1 | parentAttr1: "PA1" 2 | parentAttr2: "PA2" 3 | children: 4 | - childAttr1: "CA11" 5 | childAttr2: "CA12" 6 | - childAttr1: "CA21" 7 | childAttr2: "CA22" 8 | childAttr3: "CA23" 9 | -------------------------------------------------------------------------------- /kork-plugins/src/test/resources/yaml/test.yml: -------------------------------------------------------------------------------- 1 | name: hello 2 | -------------------------------------------------------------------------------- /kork-plugins/v2-plugin-framework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spinnaker/kork/a7b6fdea15ec2e98c80093947f194afb0ee552f3/kork-plugins/v2-plugin-framework.png -------------------------------------------------------------------------------- /kork-proto/kork-proto.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "java-library" 3 | id "com.google.protobuf" version "0.8.12" 4 | } 5 | 6 | dependencies { 7 | api(platform(project(":spinnaker-dependencies"))) 8 | 9 | implementation "com.google.protobuf:protobuf-java" 10 | } 11 | 12 | protobuf { 13 | protoc { 14 | // TODO: figure out how to reference version in BOM. 15 | artifact = "com.google.protobuf:protoc:3.21.12" 16 | } 17 | } 18 | 19 | idea { 20 | module { 21 | generatedSourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /kork-pubsub-aws/src/main/java/com/netflix/spinnaker/kork/pubsub/aws/AmazonSubscriptionInformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.pubsub.aws; 18 | 19 | import com.amazonaws.services.sns.AmazonSNS; 20 | import com.amazonaws.services.sqs.AmazonSQS; 21 | import com.netflix.spinnaker.kork.pubsub.aws.config.AmazonPubsubProperties; 22 | import lombok.Builder; 23 | import lombok.Data; 24 | 25 | @Data 26 | @Builder 27 | public class AmazonSubscriptionInformation { 28 | AmazonPubsubProperties.AmazonPubsubSubscription properties; 29 | AmazonSQS amazonSQS; 30 | AmazonSNS amazonSNS; 31 | String queueUrl; 32 | } 33 | -------------------------------------------------------------------------------- /kork-pubsub-aws/src/main/java/com/netflix/spinnaker/kork/pubsub/aws/MessageAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.pubsub.aws; 18 | 19 | import com.fasterxml.jackson.annotation.JsonProperty; 20 | import lombok.AllArgsConstructor; 21 | import lombok.Data; 22 | 23 | @Data 24 | @AllArgsConstructor 25 | public class MessageAttribute { 26 | @JsonProperty("Type") 27 | private String attributeType; 28 | 29 | @JsonProperty("Value") 30 | private String attributeValue; 31 | } 32 | -------------------------------------------------------------------------------- /kork-pubsub-aws/src/main/java/com/netflix/spinnaker/kork/pubsub/aws/api/AmazonMessageAcknowledger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.pubsub.aws.api; 18 | 19 | import com.amazonaws.services.sqs.model.Message; 20 | import com.netflix.spinnaker.kork.pubsub.aws.AmazonSubscriptionInformation; 21 | import com.netflix.spinnaker.kork.pubsub.model.MessageAcknowledger; 22 | 23 | public interface AmazonMessageAcknowledger 24 | extends MessageAcknowledger {} 25 | -------------------------------------------------------------------------------- /kork-pubsub/kork-pubsub.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | apply plugin: "java-library" 17 | 18 | dependencies { 19 | api(platform(project(":spinnaker-dependencies"))) 20 | 21 | implementation project(':kork-core') 22 | } 23 | -------------------------------------------------------------------------------- /kork-pubsub/src/main/java/com/netflix/spinnaker/kork/pubsub/config/PubsubConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.pubsub.config; 18 | 19 | import com.netflix.spinnaker.kork.pubsub.PubsubPublishers; 20 | import com.netflix.spinnaker.kork.pubsub.PubsubSubscribers; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | 24 | @Configuration 25 | public class PubsubConfig { 26 | 27 | @Bean 28 | PubsubSubscribers pubsubSubscribers() { 29 | return new PubsubSubscribers(); 30 | } 31 | 32 | @Bean 33 | PubsubPublishers pubsubPublishers() { 34 | return new PubsubPublishers(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /kork-pubsub/src/main/java/com/netflix/spinnaker/kork/pubsub/model/MessageAcknowledger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.pubsub.model; 18 | 19 | /** Interface for acknowledging and ignoring pubsub messages */ 20 | public interface MessageAcknowledger { 21 | /** acknowledges that a message has been successfully processed */ 22 | void ack(S subscriptionInformation, T message); 23 | 24 | /** negative-acknowledge, when there was an error processing the message */ 25 | void nack(S subscriptionInformation, T message); 26 | } 27 | -------------------------------------------------------------------------------- /kork-pubsub/src/main/java/com/netflix/spinnaker/kork/pubsub/model/PubsubSubscriber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.pubsub.model; 18 | 19 | /** 20 | * One subscriber exists for each subscription, and facilitates getting messages from the 21 | * subscription. 22 | */ 23 | public interface PubsubSubscriber { 24 | String getPubsubSystem(); 25 | 26 | String getSubscriptionName(); 27 | 28 | String getName(); 29 | } 30 | -------------------------------------------------------------------------------- /kork-retrofit/kork-retrofit.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/kotlin-test.gradle" 3 | apply from: "$rootDir/gradle/lombok.gradle" 4 | 5 | dependencies { 6 | api(platform(project(":spinnaker-dependencies"))) 7 | api "com.squareup.retrofit:retrofit" 8 | api "com.squareup.retrofit2:retrofit" 9 | 10 | implementation project(":kork-web") 11 | 12 | implementation "com.jakewharton.retrofit:retrofit1-okhttp3-client" 13 | implementation "com.squareup.retrofit:converter-jackson" 14 | implementation "io.zipkin.brave:brave-instrumentation-okhttp3" 15 | implementation "com.squareup.retrofit2:converter-jackson" 16 | implementation "com.squareup.okhttp3:logging-interceptor" 17 | implementation "com.google.guava:guava" 18 | 19 | testImplementation project(":kork-test") 20 | testImplementation "org.spockframework:spock-core" 21 | testImplementation "org.spockframework:spock-spring" 22 | testImplementation "org.springframework.boot:spring-boot-starter-test" 23 | testImplementation "com.netflix.spectator:spectator-reg-micrometer" 24 | testImplementation "com.squareup.okhttp3:mockwebserver" 25 | testRuntimeOnly "cglib:cglib-nodep" 26 | testRuntimeOnly "org.objenesis:objenesis" 27 | } 28 | -------------------------------------------------------------------------------- /kork-retrofit/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kork-retrofit/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.kork.retrofit.RetrofitServiceFactoryAutoConfiguration 2 | -------------------------------------------------------------------------------- /kork-retrofit/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /kork-retrofit2/kork-retrofit2.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/kotlin-test.gradle" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | implementation project(":kork-web") 7 | implementation project(":kork-retrofit") 8 | implementation "com.squareup.retrofit2:retrofit" 9 | implementation "com.squareup.retrofit2:converter-jackson" 10 | implementation "com.squareup.okhttp3:logging-interceptor" 11 | implementation "io.zipkin.brave:brave-instrumentation-okhttp3" 12 | 13 | testImplementation "org.springframework.boot:spring-boot-starter-test" 14 | testRuntimeOnly "cglib:cglib-nodep" 15 | testRuntimeOnly "org.objenesis:objenesis" 16 | 17 | testImplementation "com.squareup.okhttp3:mockwebserver" 18 | testImplementation "com.squareup.retrofit2:retrofit-mock" 19 | testImplementation "com.github.tomakehurst:wiremock-jre8" 20 | 21 | } 22 | -------------------------------------------------------------------------------- /kork-retrofit2/src/main/java/com/netflix/spinnaker/kork/retrofit/Retrofit2ConfigurationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.kork.retrofit; 19 | 20 | import okhttp3.logging.HttpLoggingInterceptor; 21 | import org.springframework.boot.context.properties.ConfigurationProperties; 22 | 23 | @ConfigurationProperties("retrofit2") 24 | public class Retrofit2ConfigurationProperties { 25 | 26 | private HttpLoggingInterceptor.Level logLevel = HttpLoggingInterceptor.Level.BASIC; 27 | 28 | public HttpLoggingInterceptor.Level getLogLevel() { 29 | return logLevel; 30 | } 31 | 32 | public void setLogLevel(HttpLoggingInterceptor.Level logLevel) { 33 | this.logLevel = logLevel; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /kork-retrofit2/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kork-retrofit2/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.kork.retrofit.Retrofit2ServiceFactoryAutoConfiguration 2 | -------------------------------------------------------------------------------- /kork-runtime/README.md: -------------------------------------------------------------------------------- 1 | # kork-runtime 2 | 3 | This module serves as a collection of the runtime dependencies in the kork 4 | project that should be added to the service module for a standard Spinnaker 5 | service - similar to a spring-boot-starter style module for Spinnaker 6 | services. 7 | 8 | As we add new or refactor existing runtime only dependencies we can collect 9 | the dependencies here so that as we autobump out kork releases services will 10 | pick up those changes. 11 | 12 | -------------------------------------------------------------------------------- /kork-runtime/kork-runtime.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | runtimeOnly(platform(project(":spinnaker-dependencies"))) 3 | 4 | // Add each included runtime project as a runtime dependency 5 | gradle.includedRuntimeProjects.each { 6 | runtimeOnly project(it) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /kork-secrets-aws/kork-secrets-aws.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/lombok.gradle" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | 7 | api project(':kork-secrets') 8 | 9 | implementation "com.amazonaws:aws-java-sdk-s3" 10 | implementation "com.amazonaws:aws-java-sdk-secretsmanager" 11 | implementation "org.apache.commons:commons-lang3" 12 | implementation "org.springframework.boot:spring-boot-autoconfigure" 13 | 14 | runtimeOnly "com.amazonaws:aws-java-sdk-sts" 15 | 16 | testImplementation "org.junit.jupiter:junit-jupiter-api" 17 | testImplementation "org.mockito:mockito-core" 18 | testImplementation "org.mockito:mockito-junit-jupiter" 19 | testImplementation "org.testcontainers:localstack" 20 | testImplementation "org.springframework:spring-test" 21 | testImplementation "org.springframework.boot:spring-boot-test" 22 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" 23 | } 24 | -------------------------------------------------------------------------------- /kork-secrets/kork-secrets.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply plugin: "groovy" 3 | apply from: "$rootDir/gradle/lombok.gradle" 4 | 5 | dependencies { 6 | api(platform(project(":spinnaker-dependencies"))) 7 | 8 | api project(":kork-core") 9 | api project(":kork-security") 10 | api "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml" 11 | api "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor" 12 | implementation "org.springframework.boot:spring-boot-autoconfigure" 13 | implementation "org.springframework.boot:spring-boot-starter-actuator" 14 | implementation "org.yaml:snakeyaml" 15 | implementation "com.google.guava:guava" 16 | implementation "org.apache.commons:commons-lang3" 17 | implementation "org.apache.logging.log4j:log4j-api" 18 | 19 | testImplementation "com.hubspot.jinjava:jinjava" 20 | testImplementation "org.spockframework:spock-core" 21 | testImplementation "org.junit.jupiter:junit-jupiter-api" 22 | testRuntimeOnly "cglib:cglib-nodep" 23 | testRuntimeOnly "org.objenesis:objenesis" 24 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" 25 | 26 | testImplementation("org.springframework:spring-test") 27 | testImplementation("org.springframework.boot:spring-boot-test") 28 | testImplementation("org.mockito:mockito-core") 29 | testImplementation("org.mockito:mockito-junit-jupiter") 30 | } 31 | -------------------------------------------------------------------------------- /kork-secrets/src/main/java/com/netflix/spinnaker/kork/secrets/InvalidSecretFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Armory, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.secrets; 18 | 19 | public class InvalidSecretFormatException extends SecretException { 20 | 21 | public InvalidSecretFormatException() { 22 | super(); 23 | } 24 | 25 | public InvalidSecretFormatException(String message) { 26 | super(message); 27 | } 28 | 29 | public InvalidSecretFormatException(Throwable cause) { 30 | super(cause); 31 | } 32 | 33 | public InvalidSecretFormatException(String message, Throwable cause) { 34 | super(message, cause); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /kork-secrets/src/main/java/com/netflix/spinnaker/kork/secrets/SecretDecryptionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Armory, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.secrets; 18 | 19 | public class SecretDecryptionException extends SecretException { 20 | 21 | public SecretDecryptionException() {} 22 | 23 | public SecretDecryptionException(String message) { 24 | super(message); 25 | } 26 | 27 | public SecretDecryptionException(Throwable cause) { 28 | super(cause); 29 | } 30 | 31 | public SecretDecryptionException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /kork-secrets/src/main/java/com/netflix/spinnaker/kork/secrets/SecretException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Armory, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.secrets; 18 | 19 | public class SecretException extends RuntimeException { 20 | 21 | public SecretException() { 22 | super(); 23 | } 24 | 25 | public SecretException(String message) { 26 | super(message); 27 | } 28 | 29 | public SecretException(Throwable cause) { 30 | super(cause); 31 | } 32 | 33 | public SecretException(String message, Throwable cause) { 34 | super(message, cause); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /kork-secrets/src/main/java/com/netflix/spinnaker/kork/secrets/StandardSecretParameter.java: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.secrets; 2 | 3 | import javax.annotation.Nonnull; 4 | import lombok.Getter; 5 | 6 | public enum StandardSecretParameter { 7 | KEY("k"), 8 | ENCODING("e"); 9 | 10 | @Getter @Nonnull private final String parameterName; 11 | 12 | StandardSecretParameter(String parameterName) { 13 | this.parameterName = parameterName; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /kork-secrets/src/main/java/com/netflix/spinnaker/kork/secrets/user/StringUserSecretData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.secrets.user; 18 | 19 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 20 | import lombok.RequiredArgsConstructor; 21 | 22 | @NonnullByDefault 23 | @RequiredArgsConstructor 24 | // not using @UserSecretType as this is an unstructured type 25 | // see StringUserSecretSerde 26 | public class StringUserSecretData implements UserSecretData { 27 | private final String data; 28 | 29 | @Override 30 | public String getSecretString(String key) { 31 | return data; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kork-secrets/src/main/java/com/netflix/spinnaker/kork/secrets/user/UserSecretData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.secrets.user; 18 | 19 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 20 | 21 | @NonnullByDefault 22 | public interface UserSecretData { 23 | /** Gets the value of this secret with the provided key and returns a string encoding of it. */ 24 | String getSecretString(String key); 25 | } 26 | -------------------------------------------------------------------------------- /kork-secrets/src/main/java/com/netflix/spinnaker/kork/secrets/user/UserSecretMetadataField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.secrets.user; 18 | 19 | import lombok.Getter; 20 | 21 | public enum UserSecretMetadataField { 22 | TYPE("type"), 23 | ENCODING("encoding"), 24 | ROLES("roles"); 25 | 26 | public static final String PREFIX = "spinnaker:"; 27 | 28 | @Getter private final String tagKey; 29 | 30 | UserSecretMetadataField(String tagKey) { 31 | this.tagKey = PREFIX + tagKey; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kork-secrets/src/main/java/com/netflix/spinnaker/kork/secrets/user/UserSecretMixin.java: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.secrets.user; 2 | 3 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 4 | 5 | /** 6 | * Jackson mixin for {@link UserSecret} to support encoding and decoding user secrets based on a 7 | * provided {@code type} property. 8 | */ 9 | @JsonTypeInfo( 10 | use = JsonTypeInfo.Id.NAME, 11 | include = JsonTypeInfo.As.EXISTING_PROPERTY, 12 | property = "type") 13 | public interface UserSecretMixin {} 14 | -------------------------------------------------------------------------------- /kork-secrets/src/main/java/com/netflix/spinnaker/kork/secrets/user/UserSecretSerde.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.secrets.user; 18 | 19 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 20 | 21 | @NonnullByDefault 22 | public interface UserSecretSerde { 23 | boolean supports(UserSecretMetadata metadata); 24 | 25 | UserSecret deserialize(byte[] encoded, UserSecretMetadata metadata); 26 | 27 | byte[] serialize(UserSecretData secret, UserSecretMetadata metadata); 28 | } 29 | -------------------------------------------------------------------------------- /kork-secrets/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kork-secrets/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.kork.secrets.SecretConfiguration 2 | -------------------------------------------------------------------------------- /kork-security/kork-security.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply plugin: "groovy" 3 | apply from: "$rootDir/gradle/lombok.gradle" 4 | 5 | dependencies { 6 | api(platform(project(":spinnaker-dependencies"))) 7 | 8 | implementation(project(":kork-core")) 9 | 10 | api "org.springframework.security:spring-security-core" 11 | api "com.fasterxml.jackson.core:jackson-annotations" 12 | 13 | implementation "com.google.guava:guava" 14 | implementation "org.apache.logging.log4j:log4j-api" 15 | implementation "org.slf4j:slf4j-api" 16 | 17 | testImplementation "org.spockframework:spock-core" 18 | testRuntimeOnly "ch.qos.logback:logback-classic" 19 | testRuntimeOnly "cglib:cglib-nodep" 20 | testRuntimeOnly "org.objenesis:objenesis" 21 | } 22 | -------------------------------------------------------------------------------- /kork-security/src/main/java/com/netflix/spinnaker/security/AuthorizationMapControlled.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.security; 19 | 20 | import javax.annotation.Nullable; 21 | 22 | /** 23 | * Common interface for access-controlled classes which use a permission map of {@link 24 | * Authorization} enums. 25 | */ 26 | public interface AuthorizationMapControlled extends PermissionMapControlled { 27 | @Nullable 28 | @Override 29 | default Authorization valueOf(@Nullable Object authorization) { 30 | return Authorization.parse(authorization); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /kork-security/src/main/java/com/netflix/spinnaker/security/UserPermissionEvaluator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Salesforce, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.security; 18 | 19 | import java.io.Serializable; 20 | import org.springframework.security.access.PermissionEvaluator; 21 | 22 | /** 23 | * Make it possible to authorize by username in kork (e.g. in S3ArtifactStoreGetter), as 24 | * FiatPermissionEvaluator currently does. 25 | */ 26 | public interface UserPermissionEvaluator extends PermissionEvaluator { 27 | 28 | boolean hasPermission( 29 | String username, Serializable resourceName, String resourceType, Object authorization); 30 | } 31 | -------------------------------------------------------------------------------- /kork-security/src/test/groovy/com/netflix/spinnaker/security/MDCSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | package com.netflix.spinnaker.security 19 | 20 | import org.slf4j.MDC 21 | import spock.lang.Specification 22 | 23 | class MDCSpec extends Specification { 24 | def "should not propagate context across threads"() { 25 | given: 26 | MDC.put("test", "string") 27 | 28 | when: 29 | def childThreadValue 30 | def t = Thread.start { 31 | childThreadValue = MDC.get("test") 32 | } 33 | t.join() 34 | 35 | then: 36 | MDC.get("test") == "string" 37 | childThreadValue == null 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /kork-sql-test/kork-sql-test.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | 3 | dependencies { 4 | api(platform(project(":spinnaker-dependencies"))) 5 | api project(":kork-sql") 6 | 7 | api("org.testcontainers:mysql") 8 | api("org.testcontainers:postgresql") 9 | 10 | testImplementation "org.junit.jupiter:junit-jupiter-api" 11 | 12 | runtimeOnly "com.h2database:h2" 13 | 14 | testRuntimeOnly "com.mysql:mysql-connector-j" 15 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" 16 | testRuntimeOnly "org.postgresql:postgresql" 17 | } 18 | -------------------------------------------------------------------------------- /kork-sql-test/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /kork-sql/kork-sql.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/kotlin.gradle" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | 7 | api project(":kork-core") 8 | api project(":kork-security") 9 | api "org.springframework:spring-jdbc" 10 | api "org.springframework:spring-tx" 11 | api "org.jooq:jooq" 12 | api "org.liquibase:liquibase-core" 13 | api "com.zaxxer:HikariCP" 14 | 15 | implementation 'com.github.blagerweij:liquibase-sessionlock:1.5.0' 16 | implementation "javax.validation:validation-api" 17 | implementation "org.hibernate.validator:hibernate-validator" 18 | 19 | testImplementation project(":kork-sql-test") 20 | testImplementation "org.springframework.boot:spring-boot-starter-actuator" 21 | testImplementation "org.springframework.boot:spring-boot-starter-web" 22 | testImplementation "org.springframework.boot:spring-boot-starter-test" 23 | 24 | testRuntimeOnly project(":kork-web") 25 | testRuntimeOnly "com.mysql:mysql-connector-j" 26 | } 27 | 28 | detekt { 29 | ignoreFailures = false 30 | } 31 | -------------------------------------------------------------------------------- /kork-sql/src/main/kotlin/com/netflix/spinnaker/kork/sql/routing/NamedDataSourceRouter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.sql.routing 17 | 18 | import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource 19 | 20 | /** 21 | * Routes queries to a specific database based on the datasource name, as stored in a ThreadLocal. 22 | */ 23 | class NamedDataSourceRouter : AbstractRoutingDataSource() { 24 | override fun determineCurrentLookupKey(): Any? = 25 | NamedDatabaseContextHolder.get() 26 | } 27 | -------------------------------------------------------------------------------- /kork-sql/src/main/kotlin/com/netflix/spinnaker/kork/sql/routing/NamedDatabaseContextHolder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.sql.routing 17 | 18 | /** 19 | * Holds the thread local connection pool context. 20 | */ 21 | object NamedDatabaseContextHolder { 22 | 23 | private val context: ThreadLocal = ThreadLocal() 24 | 25 | fun set(name: String) { 26 | context.set(name.toLowerCase()) 27 | } 28 | 29 | fun get(): String? = context.get() 30 | 31 | fun clear() { 32 | context.remove() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /kork-sql/src/main/kotlin/com/netflix/spinnaker/kork/sql/routing/StaticDataSourceLookup.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.sql.routing 17 | 18 | import javax.sql.DataSource 19 | import org.springframework.jdbc.datasource.lookup.DataSourceLookup 20 | 21 | /** 22 | * Lookup a [DataSource] by name from a static set. 23 | */ 24 | class StaticDataSourceLookup( 25 | /** 26 | * Publicly exposed as a registry of all target DataSources without digging through the Spring Environment elsewhere. 27 | */ 28 | private val dataSources: Map 29 | ) : DataSourceLookup { 30 | 31 | override fun getDataSource(dataSourceName: String): DataSource? = 32 | dataSources[dataSourceName] 33 | } 34 | -------------------------------------------------------------------------------- /kork-sql/src/main/resources/db/healthcheck.yml: -------------------------------------------------------------------------------- 1 | databaseChangeLog: 2 | - changeSet: 3 | id: create-healthcheck-table 4 | author: robzienert 5 | changes: 6 | - createTable: 7 | tableName: healthcheck 8 | columns: 9 | - column: 10 | name: id 11 | type: boolean 12 | constraints: 13 | primaryKey: true 14 | nullable: false 15 | - modifySql: 16 | dbms: mysql 17 | append: 18 | value: " engine innodb" 19 | rollback: 20 | - dropTable: 21 | tableName: healthcheck 22 | -------------------------------------------------------------------------------- /kork-sql/src/test/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: test 3 | 4 | sql: 5 | enabled: false 6 | 7 | --- 8 | spring: 9 | profiles: twodialects 10 | 11 | sql: 12 | enabled: true 13 | connectionPools: 14 | default: 15 | jdbcUrl: "jdbc:h2:mem:test" 16 | default: true 17 | user: 18 | password: 19 | secondary: 20 | enabled: true 21 | jdbcUrl: "jdbc:h2:mem:test" 22 | dialect: H2 23 | user: 24 | password: 25 | migration: 26 | jdbcUrl: "jdbc:h2:mem:test" 27 | user: 28 | password: 29 | duplicateFileMode: WARN 30 | secondaryMigration: 31 | jdbcUrl: "jdbc:h2:mem:test" 32 | user: 33 | password: 34 | duplicateFileMode: WARN 35 | --- 36 | 37 | spring: 38 | profiles: singledialect 39 | 40 | sql: 41 | enabled: true 42 | connectionPools: 43 | default: 44 | jdbcUrl: "jdbc:h2:mem:test" 45 | default: true 46 | user: 47 | password: 48 | secondary: 49 | enabled: true 50 | jdbcUrl: "jdbc:h2:mem:test" 51 | user: 52 | password: 53 | migration: 54 | jdbcUrl: "jdbc:h2:mem:test" 55 | user: 56 | password: 57 | duplicateFileMode: WARN 58 | -------------------------------------------------------------------------------- /kork-sql/src/test/resources/db/changelog-master.yml: -------------------------------------------------------------------------------- 1 | databaseChangeLog: 2 | - changeSet: 3 | id: create-sample-table 4 | author: kirangodishala 5 | changes: 6 | - createTable: 7 | tableName: sample 8 | columns: 9 | - column: 10 | name: id 11 | type: boolean 12 | constraints: 13 | primaryKey: true 14 | nullable: false 15 | - modifySql: 16 | dbms: mysql 17 | append: 18 | value: " engine innodb" 19 | rollback: 20 | - dropTable: 21 | tableName: sample 22 | -------------------------------------------------------------------------------- /kork-sql/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /kork-sql/src/test/resources/mysql-set-global-transaction-isolation.sql: -------------------------------------------------------------------------------- 1 | SET GLOBAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED 2 | -------------------------------------------------------------------------------- /kork-sql/src/test/resources/mysql-set-session-transaction-isolation.sql: -------------------------------------------------------------------------------- 1 | SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED 2 | -------------------------------------------------------------------------------- /kork-swagger/kork-swagger.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | 3 | dependencies { 4 | api(platform(project(":spinnaker-dependencies"))) 5 | 6 | implementation "com.google.guava:guava" 7 | implementation "org.springframework.boot:spring-boot-autoconfigure" 8 | implementation "org.springdoc:springdoc-openapi-ui" 9 | implementation "org.springframework:spring-webmvc" 10 | implementation "io.swagger.core.v3:swagger-annotations" 11 | implementation "io.swagger.core.v3:swagger-core" 12 | } 13 | -------------------------------------------------------------------------------- /kork-telemetry/kork-telemetry.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply plugin: "groovy" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | api project(":kork-annotations") 7 | 8 | api "com.netflix.spectator:spectator-api" 9 | api "com.github.ben-manes.caffeine:guava" 10 | 11 | testImplementation "com.hubspot.jinjava:jinjava" 12 | testImplementation "org.spockframework:spock-core" 13 | testRuntimeOnly "cglib:cglib-nodep" 14 | testRuntimeOnly "org.objenesis:objenesis" 15 | } 16 | -------------------------------------------------------------------------------- /kork-telemetry/src/main/java/com/netflix/spinnaker/kork/telemetry/MetricTags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.telemetry; 17 | 18 | /** A collection of standard metric tags. */ 19 | public class MetricTags { 20 | 21 | public static final String RESULT_KEY = "result"; 22 | 23 | public enum ResultValue { 24 | SUCCESS("success"), 25 | FAILURE("failure"); 26 | 27 | private final String value; 28 | 29 | ResultValue(String value) { 30 | this.value = value; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kork-test/kork-test.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/kotlin.gradle" 3 | 4 | dependencies { 5 | api(platform(project(":spinnaker-dependencies"))) 6 | api "com.google.code.findbugs:jsr305" 7 | 8 | 9 | implementation project(":kork-exceptions") 10 | implementation project(":kork-moniker") 11 | implementation "org.slf4j:slf4j-api" 12 | implementation "ch.qos.logback:logback-classic" 13 | implementation "ch.qos.logback:logback-core" 14 | implementation "com.fasterxml.jackson.core:jackson-core" 15 | implementation "com.fasterxml.jackson.core:jackson-databind" 16 | implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml" 17 | implementation "org.springframework:spring-core" 18 | implementation "org.jetbrains:annotations" 19 | implementation "org.apache.commons:commons-lang3" 20 | } 21 | -------------------------------------------------------------------------------- /kork-test/src/main/resources/mimicker-aws.yml: -------------------------------------------------------------------------------- 1 | # TODO(rz): Should generate this stuff from AWS APIs... 2 | mimicker: 3 | aws: 4 | regions: 5 | - us-west-2 6 | - us-east-1 7 | - eu-west-1 8 | availabilityZones: 9 | us-west-2: 10 | - us-west-2a 11 | - us-west-2b 12 | - us-west-2c 13 | us-east-1: 14 | - us-east-1a 15 | - us-east-1b 16 | - us-east-1c 17 | eu-west-1: 18 | - eu-west-1a 19 | - eu-west-1b 20 | - eu-west-1c 21 | instanceTypes: 22 | - a1.medium 23 | - i3en.metal 24 | - m5.4xlarge 25 | - m5ad.xlarge 26 | - m5d.large 27 | - t3.nano 28 | -------------------------------------------------------------------------------- /kork-test/src/main/resources/mimicker.yml: -------------------------------------------------------------------------------- 1 | mimicker: 2 | words: 3 | - executive 4 | - psychology 5 | - relinquish 6 | - struggle 7 | - vehicle 8 | - hand 9 | - chest 10 | - swarm 11 | - waste 12 | - needle 13 | - length 14 | - spontaneous 15 | - boats 16 | - established 17 | - pirate 18 | - build 19 | - infrastructure 20 | - licence 21 | - temperature 22 | - content 23 | -------------------------------------------------------------------------------- /kork-test/src/test/kotlin/com/netflix/spinnaker/kork/test/mimicker/producers/MonikerProducerTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.spinnaker.kork.test.mimicker.producers 17 | 18 | import dev.minutest.junit.JUnit5Minutests 19 | import dev.minutest.rootContext 20 | import java.security.SecureRandom 21 | import strikt.api.expectThat 22 | import strikt.assertions.isNotSameInstanceAs 23 | 24 | class MonikerProducerTest : JUnit5Minutests { 25 | 26 | fun tests() = rootContext { 27 | fixture { 28 | MonikerProducer(RandomProducer(SecureRandom())) 29 | } 30 | 31 | test("get creates new moniker") { 32 | expectThat(get()).isNotSameInstanceAs(get()) 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /kork-test/src/test/resources/mimicker-foo.yml: -------------------------------------------------------------------------------- 1 | mimicker: 2 | foo: 3 | hello: world 4 | -------------------------------------------------------------------------------- /kork-tomcat/kork-tomcat.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java-library" 2 | apply from: "$rootDir/gradle/kotlin-test.gradle" 3 | 4 | dependencies { 5 | 6 | api(platform(project(":spinnaker-dependencies"))) 7 | implementation("org.springframework.boot:spring-boot-starter-web") 8 | implementation("com.netflix.spectator:spectator-api") 9 | implementation("com.google.guava:guava") 10 | implementation(project(":kork-core")) 11 | implementation(project(":kork-crypto")) 12 | 13 | testImplementation "org.springframework.boot:spring-boot-starter-test" 14 | } 15 | -------------------------------------------------------------------------------- /kork-tomcat/src/main/java/com/netflix/spinnaker/kork/tomcat/x509/Blocklist.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.tomcat.x509; 18 | 19 | import java.security.cert.X509Certificate; 20 | 21 | public interface Blocklist { 22 | 23 | static Blocklist forFile(String blocklistFile) { 24 | return new ReloadingFileBlocklist(blocklistFile); 25 | } 26 | 27 | boolean isBlocklisted(X509Certificate cert); 28 | } 29 | -------------------------------------------------------------------------------- /kork-tomcat/src/main/java/com/netflix/spinnaker/kork/tomcat/x509/BlocklistEnabledDynamicConfigMonitor.java: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.kork.tomcat.x509; 2 | 3 | import com.netflix.spinnaker.kork.dynamicconfig.DynamicConfigService; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.scheduling.annotation.Scheduled; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class BlocklistEnabledDynamicConfigMonitor { 10 | private final DynamicConfigService dynamicConfigService; 11 | 12 | @Autowired 13 | public BlocklistEnabledDynamicConfigMonitor(DynamicConfigService dynamicConfigService) { 14 | this.dynamicConfigService = dynamicConfigService; 15 | syncEnabledProperty(); 16 | } 17 | 18 | @Scheduled(fixedRate = 5000L) 19 | public void syncEnabledProperty() { 20 | BlocklistingX509TrustManager.BLOCKLIST_ENABLED.set( 21 | dynamicConfigService.isEnabled("ssl.blocklist", true)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /kork-tomcat/src/main/java/com/netflix/spinnaker/kork/tomcat/x509/SslExtensionConfigurationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.tomcat.x509; 18 | 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | 21 | @ConfigurationProperties("server.ssl") 22 | public class SslExtensionConfigurationProperties { 23 | private String crlFile = null; 24 | 25 | public String getCrlFile() { 26 | return crlFile; 27 | } 28 | 29 | public void setCrlFile(String crlFile) { 30 | this.crlFile = crlFile; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /kork-tomcat/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /kork-tomcat/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.netflix.spinnaker.kork.tomcat.TomcatConfiguration 2 | -------------------------------------------------------------------------------- /kork-web/src/main/groovy/com/netflix/spinnaker/retrofit/Retrofit2ConfigurationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 OpsMx, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.retrofit; 18 | 19 | import okhttp3.logging.HttpLoggingInterceptor; 20 | import org.springframework.boot.context.properties.ConfigurationProperties; 21 | 22 | @ConfigurationProperties("retrofit2") 23 | public class Retrofit2ConfigurationProperties { 24 | HttpLoggingInterceptor.Level logLevel = HttpLoggingInterceptor.Level.BASIC; 25 | 26 | public HttpLoggingInterceptor.Level getLogLevel() { 27 | return logLevel; 28 | } 29 | 30 | public void setLogLevel(HttpLoggingInterceptor.Level logLevel) { 31 | this.logLevel = logLevel; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kork-web/src/main/groovy/com/netflix/spinnaker/retrofit/RetrofitConfigurationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.retrofit; 18 | 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | import retrofit.RestAdapter; 21 | 22 | @ConfigurationProperties("retrofit") 23 | public class RetrofitConfigurationProperties { 24 | RestAdapter.LogLevel logLevel = RestAdapter.LogLevel.BASIC; 25 | 26 | public RestAdapter.LogLevel getLogLevel() { 27 | return logLevel; 28 | } 29 | 30 | public void setLogLevel(RestAdapter.LogLevel logLevel) { 31 | this.logLevel = logLevel; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kork-web/src/main/groovy/com/netflix/spinnaker/retrofit/Slf4jRetrofitLogger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.retrofit; 18 | 19 | import java.util.Objects; 20 | import org.slf4j.Logger; 21 | import org.slf4j.LoggerFactory; 22 | import retrofit.RestAdapter; 23 | 24 | public class Slf4jRetrofitLogger implements RestAdapter.Log { 25 | private final Logger logger; 26 | 27 | public Slf4jRetrofitLogger(Class type) { 28 | this(LoggerFactory.getLogger(type)); 29 | } 30 | 31 | public Slf4jRetrofitLogger(Logger logger) { 32 | this.logger = Objects.requireNonNull(logger); 33 | } 34 | 35 | @Override 36 | public void log(String message) { 37 | logger.info(message); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /kork-web/src/main/java/com/netflix/spinnaker/config/BinderControllerAdvice.java: -------------------------------------------------------------------------------- 1 | package com.netflix.spinnaker.config; 2 | 3 | import java.util.Arrays; 4 | import java.util.HashSet; 5 | import java.util.Optional; 6 | import java.util.Set; 7 | import org.springframework.core.annotation.Order; 8 | import org.springframework.web.bind.WebDataBinder; 9 | import org.springframework.web.bind.annotation.ControllerAdvice; 10 | import org.springframework.web.bind.annotation.InitBinder; 11 | 12 | /** 13 | * Temporary mitigation for RCE in Spring Core 14 | * (https://bugalert.org/content/notices/2022-03-30-spring.html) Code from 15 | * https://www.praetorian.com/blog/spring-core-jdk9-rce/ 16 | */ 17 | @ControllerAdvice 18 | @Order(10000) 19 | public class BinderControllerAdvice { 20 | 21 | @InitBinder 22 | public void setAllowedFields(WebDataBinder dataBinder) { 23 | Set disallowedFields = 24 | Optional.ofNullable(dataBinder.getDisallowedFields()) 25 | .map(existingFields -> new HashSet<>(Arrays.asList(existingFields))) 26 | .orElse(new HashSet<>()); 27 | disallowedFields.addAll(Arrays.asList("class.*", "Class.*", "*.class.*", "*.Class.*")); 28 | dataBinder.setDisallowedFields(disallowedFields.toArray(new String[0])); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /kork-web/src/main/java/com/netflix/spinnaker/config/okhttp3/OkHttpClientCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Apple Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.config.okhttp3; 18 | 19 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 20 | import okhttp3.OkHttpClient; 21 | import org.springframework.beans.factory.ObjectProvider; 22 | 23 | /** 24 | * Beans of this type may customize a {@link OkHttpClient.Builder} prototype. 25 | * 26 | * @see RefreshableOkHttpClientBuilderProvider 27 | * @see com.netflix.spinnaker.config.OkHttpClientComponents#okHttpClientBuilder(ObjectProvider) 28 | */ 29 | @NonnullByDefault 30 | @FunctionalInterface 31 | public interface OkHttpClientCustomizer { 32 | void customize(OkHttpClient.Builder builder); 33 | } 34 | -------------------------------------------------------------------------------- /kork-web/src/main/java/com/netflix/spinnaker/config/okhttp3/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | @NonnullByDefault 18 | package com.netflix.spinnaker.config.okhttp3; 19 | 20 | import com.netflix.spinnaker.kork.annotations.NonnullByDefault; 21 | -------------------------------------------------------------------------------- /kork-web/src/main/java/com/netflix/spinnaker/kork/web/context/AuthenticatedRequestContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.netflix.spinnaker.kork.web.context; 19 | 20 | import com.netflix.spinnaker.security.AuthenticatedRequest; 21 | import java.util.Optional; 22 | 23 | public class AuthenticatedRequestContext implements RequestContext { 24 | @Override 25 | public Optional get(String header) { 26 | return AuthenticatedRequest.get(header); 27 | } 28 | 29 | @Override 30 | public void set(String header, String value) { 31 | AuthenticatedRequest.set(header, value); 32 | } 33 | 34 | @Override 35 | public void clear() { 36 | AuthenticatedRequest.clear(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /kork-web/src/main/java/com/netflix/spinnaker/kork/web/context/AuthenticatedRequestContextProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.web.context; 18 | 19 | public class AuthenticatedRequestContextProvider implements RequestContextProvider { 20 | private static final AuthenticatedRequestContext context = new AuthenticatedRequestContext(); 21 | 22 | @Override 23 | public RequestContext get() { 24 | return context; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /kork-web/src/main/java/com/netflix/spinnaker/kork/web/context/RequestContextProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.web.context; 18 | 19 | public interface RequestContextProvider { 20 | RequestContext get(); 21 | } 22 | -------------------------------------------------------------------------------- /kork-web/src/main/java/com/netflix/spinnaker/kork/web/selector/ServiceSelector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.spinnaker.kork.web.selector; 18 | 19 | public interface ServiceSelector { 20 | T getService(); 21 | 22 | int getPriority(); 23 | 24 | boolean supports(SelectableService.Criteria criteria); 25 | } 26 | -------------------------------------------------------------------------------- /lombok.config: -------------------------------------------------------------------------------- 1 | # This file is generated by the 'io.freefair.lombok' Gradle plugin 2 | config.stopBubbling = true 3 | --------------------------------------------------------------------------------