Giter VIP home page Giter VIP logo

arkana's Introduction

Arkana

noun ‧ secret knowledge¹ — ar‧ka‧na | \är-​ˈkā-​nə\

Store your keys and secrets away from your source code. Designed for Android and iOS projects.

Latest Release Tests & Linter Swift Tests Issues Follow on Twitter

View Demo · Report Bug · Request Feature

Requirements

Android

Your project must be using the Gradle Build Tool.

iOS

Your project must be using Swift Package Manager or CocoaPods as dependency manager (or both). No support for Carthage.

Note: this gem was only tested in macOS environments.

Preview

Kotlin

Click here to see the Kotlin preview

The image below shows how the auto-generated file looks like.

Usage using the example code above:

import com.arkanakeys.MySecrets

// Designed with testability and DI in mind
println(MySecrets.Global.someBooleanSecret)
println(MySecrets.Global.someIntSecret)
println(MySecrets.Global.mySecretAPIKey)

// Simulating environment selection using a random boolean value
val keys = if (Math.random() < 0.5) MySecrets.Dev else MySecrets.Staging
println(keys.serviceKey)

Swift

Click here to see the Swift preview

The image below shows how the auto-generated file looks like.

Usage using the example code above:

import ArkanaKeys

// Designed with testability and DI in mind
print(MySecrets.Global().someBooleanSecret)
print(MySecrets.Global().someIntSecret)
print(MySecrets.Global().mySecretAPIKey)

// This is a demo, so we are using Bool.random() to simulate the environment
let keys: MySecretsEnvironmentProtocol = Bool.random() ? MySecrets.Dev() : MySecrets.Staging()
print(keys.serviceKey)

Installation

Add this gem to your Gemfile if you're using bundler (recommended):

gem 'arkana'

And then run bundle install to install it.

Alternatively, you can install it in your entire system instead (not recommended):

gem install arkana

Usage

Arkana requires the declaration of a YAML config file. Although you can name it whatever, the convention is to name it .arkana.yml. See template.yml for practical examples.

Once you have create your config file, you can run Arkana:

Usage: arkana [options]
    -c /path/to/your/.arkana.yml,    Path to your config file. Defaults to '.arkana.yml'
        --config-filepath
    -e /path/to/your/.env,           Path to your dotenv file. Defaults to '.env' if one exists.
        --dotenv-filepath
    -f, --flavor FrostedFlakes       Flavors are useful, for instance, when generating secrets for white-label projects. See the README for more information
    -i debug,release,                Optionally pass the environments that you want Arkana to generate secrets for. Useful if you only want to build a certain environment, e.g. just Debug in local machines, while only building Staging and Release in CI. Separate the keys using a comma, without spaces. When omitted, Arkana generate secrets for all environments.
        --include-environments
    -l, --lang kotlin                Language to produce keys for, e.g. kotlin, swift. Defaults to 'swift'. See the README for more information

Note that you have to prepend bundle exec before arkana if you manage your dependencies via bundler, as recommended.

Arkana only has one command, which parses your config file and env vars, generating all the code needed. Arkana should always be run before attempting to build your project, to make sure the files exist and are up-to-date (according to the current config file). This means you might need to add the Arkana run command in your CI/CD scripts, fastlane, Xcode Build Phases, or something similar.

Importing Arkana into your iOS project

Once the Arkana has been run, its files will be created according to the package_manager setting defined in your config file, so update that setting according to your project needs.

Via Swift Package Manager

If you're integrating Arkana via SPM (package_manager is set to spm), Arkana will generate its files as a local Swift Package.

You can add this package in an Xcode project or as a dependency of another Swift Package:

Adding a local Swift Package to your Xcode project

  1. Choose FileAdd Packages… and click on Add Local…. Locate and select the ArkanaKeys folder (or the name of the import_name option that you passed in your config file).
    • If you happen to have 2 nested folders with the same name ArkanaKeys, select the inner one.
  2. Select your project in the Project navigator, then select your app target and navigate to its General pane.
  3. Click the + button in the Frameworks, Libraries, and Embedded Content section, select the local package’s library product, and add it as a dependency.
    • You may need to quit Xcode and re-open the project for the new dependency to be recognized. Classic Xcode fashion.

Adding a local Swift Package to another Swift Package

Add ArkanaKeys (or the name of the import_name option that you passed in your config file) to your list of dependencies in your Package.swift file, like this:


dependencies: [
    
    .package(name: "ArkanaKeys", path: "path/to/your/dependencies/ArkanaKeys"),
    
],

Via CocoaPods

If you're integrating Arkana via CocoaPods (package_manager is set to cocoapods), Arkana will generate its files as a Development Pod.

Add ArkanaKeys and ArkanaKeysInterfaces (or the pod_name option that you passed in your config file) to your list of dependencies in your Podfile file, like this:

pod "ArkanaKeys", path: "path/to/your/dependencies/ArkanaKeys"
pod "ArkanaKeysInterfaces", path: "path/to/your/dependencies/ArkanaKeysInterfaces"

After adding its dependency, you should be able to import ArkanaKeys (or the import_name option that you passed in your config file).

We recommend you to add your ArkanaKeys directory to your .gitignore since it's an auto-generated code that will change every time you run Arkana (since its salt gets generated on each run). For more information, see How does it work?

Importing Arkana into your Android project

When importing Arkana into your project, you have two options: generating its files within a new Gradle module created by Arkana, or adding them to an existing module. The choice depends on the settings in your config file, so ensure these are updated to reflect your project's requirements.

Creating a New Arkana Gradle Module

To generate a new Gradle module containing Arkana files, follow these steps:

  1. In your config file, set the result_path to the desired name for the new Arkana module.
  2. Update your project's settings.gradle file to include this newly created Arkana module.

Adding Arkana to an Existing Gradle Module

If you prefer to add Arkana files to an existing Gradle module, follow these steps:

  1. Adjust the result_path in your config file to specify the existing Gradle module where you want to include the Arkana files.
  2. Change should_generate_gradle_build_file to false. This prevents the overwriting of your existing module's build.gradle file.

Automating Arkana Execution During Gradle Sync

For automatic execution of Arkana during Gradle sync, modify your settings.gradle file by adding the following code:

exec {
    commandLine("arkana", "--lang", "kotlin")
}

Options

--help

Will display a list of the available options.

--lang

Usage: --lang kotlin

Indicates the language to produce keys for, e.g. kotlin, swift.

Defaults to swift.

--config-file-path

Usage: --config-file-path /path/to/your/.arkana.yml

Indicates where your config file is located at.

Defaults to .arkana.yml in the current directory.

--dotenv-file-path

Usage: --dotenv-file-path /path/to/your/.env

Indicates where your .env file is located at, if you have any to be loaded.

Defaults to .env in the current directory.

--flavor

Usage: --flavor loremipsum

Passing a flavor option will change the env var lookup mechanism. Flavors are useful, for instance, when generating secrets for white-label projects.

--include-environments

Usage: --include-environments dev,staging,prod

Passing an --include-environments option will change the env var lookup mechanism. This option is useful when you want to generate secrets for specific environments only, and skip the verification that checks whether all keys from all environments are present. You might want to use this option to only build debug environments locally (and thus only require debug env vars), and only build staging and production environments in CI (and thus only expose prod env vars to your CI).

Defaults to nil, which means all your environments will be used. When passing multiple values, separate them with commas and no spaces.

Example

Let's load a flavor called snowflakes and load a secret called MySecretAPIKey:

Run bundle exec arkana --flavor snowflakes

This will change the env var lookup method, to this particular order:

  1. Load any .env file, if present.
  2. Load any .env.snowflakes, if present (it will override the keys of .env when they conflict)
  3. Look up for a SnowflakesMySecretAPIKey env var. This could be present anywhere: both in the .env file, or in actual env vars (useful for CI environments).
  4. If SnowflakesMySecretAPIKey didn't exist, look up for a MySecretAPIKey env var.
  5. If ultimately it couldn't find any env var to populate the key MySecretAPIKey, it will throw a validation error.

This means that, if you are working with a white-label project, you can have all your env vars declared in a single .env file, or in multiple files like .env.snowflakes, .env.frosties, etc. This also means that your CI can be configured with the appropriate env vars e.g. SnowflakesMySecretAPIKey, FrostiesMySecretAPIKey, etc, with no necessity to manage (or git-version) dotenv files at all, which is the ideal way to manage secrets securely in a project.

Advanced usage

Continuous Integration

We advise you not to commit your .env files, because of security concerns. They should live in secure Environment Variables in your build (CI/CD) server instead.

Following the template.yml example file, these would be the variables that would need to be added to your build server env vars:

  • FrootLoopsAppStoreAppID
  • FrootLoopsBackendDomain
  • FrootLoopsMySecretAPIKey
  • FrootLoopsMyServiceAPIKeyDebug
  • FrootLoopsMyServiceAPIKeyRelease
  • FrostedFlakesAppStoreAppID
  • FrostedFlakesBackendDomain
  • FrostedFlakesMySecretAPIKey
  • FrostedFlakesMyServiceAPIKeyDebug
  • FrostedFlakesMyServiceAPIKeyRelease

It's okay to commit your .env files if their potential exposure wouldn't be harmful to your project, for instance when Arkana is being used in a white label project to inject variables but that are not necessarily "secrets" (e.g. app tint color, server domain, etc). You can also use .env files to store part of your env vars (only the unsecure ones), and keep the secrets in your build server's env vars.

Monorepo

If your repository makes use of a monorepo structure, then we recommend using Arkana by defining multiple .env files and multiple .arkana.yml configuration files, as it's how it was designed to be used.

One of the goals of Arkana was to use the least dotfiles as possible. This made a significant difference when designing for white-label projects (aka project flavors), because traditional dotenv implementation would suggest having multiple dotenv files such as .env.frootloops and .env.frosted if you had 2 different flavors (note that you can still use multiple dotenv files if you want so (see usage of the --flavor option). But what if you're a big agency that distributes to 25, 50, 200 clients? Maybe you don't want to be managing the distribution of 200 dotenv files across your team, and Arkana was designed with that in mind.

However, when it came to monorepo structures, we weighted the pros and cons of both approaches, and ultimately decided to the simplicity of having a set of dotfiles for each individual project, in their respective directory. The reason main reasons were:

  • the scale here is different: a project may have hundreds of flavors, but not that many projects.
  • each project already has its own dotfiles in its root directory, most likely, including .env files, and with Arkana it wouldn't be any different.
  • each project has its own quirks, so it's more scalable to put the responsibility on the project's directory to deal with its own dotenv files than to have a centralized file that would coordinate each project.
  • the complexity of maintaining a centralized configuration file that manages all projects would be too high to be implemented in Arkana. We aim for simplicity.

If you have questions on how to set this up, feel free to open an issue and we can clarify further how this can be set up.

Presence of special characters in your env vars

Dollar sign

This project is implemented in Ruby and uses the dotenv gem. Since dotenv follows bash implementation as close as possible, dollar signs ($) need to be escaped unless they are in single quotes.

For example, these are all valid:

SecretWithDollarSignEscapedAndAndNoQuotesKey = real_\$lim_shady
SecretWithDollarSignEscapedAndDoubleQuoteKey = "real_\$lim_shady"
SecretWithDollarSignNotEscapedAndSingleQuoteKey = 'real_$lim_shady'

These are not valid:

SecretWithDollarSignNotEscapedAndDoubleQuotesKey = "real_$lim_shady"
SecretWithDollarSignNotEscapedAndNoQuotesKey = real_$lim_shady

When storing your secret in actual env vars (instead of dotfiles), you will most likely need to escape them too.

Other characters to avoid

  • \ aka backslash: double scaping will be needed
  • " aka double quotes: escaping is needed

Other common special characters that are fine to be used

` ~ ! @ # % ^ & * ( ) _ - + = { [ } } | : ; ' < , > . ? /

FAQ

How does it work?

Arkana uses code generation to provide your app with its secrets. Secrets are fetched from env vars during Arkana runtime (not your app's runtime), their values are encoded using a salt that is generated on each run, and source code is generated using the provided keys, and the generated encoded values.

During your app's runtime, the encoded value is decoded so your app can use their raw values (the values that were originally stored in your env vars).

This encoding mechanism makes it difficult for attackers to simply just read your secrets in plain text from your app's binary (for instance by using unix strings, or other tools like dumpdecrypted).

Is this safe?

Key security is difficult. Right now even the biggest apps get their keys leaked. This is neatly summed up by John Adams of the Twitter Security Team on Quora.

Putting this in the context of, "should you be storing keys in software", is more appropriate. Many companies do this. It's never a good idea.

When developers do that, other developers can use debuggers and string searching commands to extract those keys from the running application. There are numerous talks on how to do that, but leave that as an exercise to the reader to find those talks.

Many people believe that obfuscating these keys in code will help. It usually won't because you can just run a debugger and find the fully functional keys.

So in summary, the ideal way to store keys is to not store keys. In reality though most Apps embed keys, and this does that and adds some rudimentary obfuscation to the keys. A well motivated app cracker could probably extract this within a few minutes however.

This excerpt has been copied in its entirety from https://github.com/orta/cocoapods-keys#security - 100% credit goes to @orta and its maintainers.

I decided to create this new gem because cocoapods-keys wasn't enough for all my (and other cocoapods-keys users') needs. The key differences between these two projects are:

  • The code generation process generates a more modern interface and protocols, under a friendly and customizable namespace, with unit tests written in the output language, and modularized architecture.
  • Flexibility: it's independent from CocoaPods. It's a CLI tool, which may or may not be used alongside CocoaPods, but also supports Swift Package Manager.
  • Extensibility: can be extended to generate secrets for Android projects as well as iOS ones.
  • Conciseness: built-in support for white-label projects and environment-specific secrets, properly making use of interfaces, and reducing amount of boilerplate configuration code to be written.

Why not a CocoaPods Plugin?

Because plugins can only be hooked to Podfiles, and not Podspec files. Thus, if you have local CocoaPods and rely only on their podspec files to generate their content, but they are consuming the secrets, then you're out of luck. The strategy that Arkana uses requires a little bit more manual work (1 LOC), but it's more flexible, reaching more projects with different setups.

If your setup uses CocoaPods, you can add this snippet at the top of your Podfile that would work just like a CocoaPods Plugin:

`bundle exec arkana --config-filepath /path/to/your/.arkana.yml --dotenv-filepath /path/to/your/.env`

Note: include the back-ticks above, they're required, so that Ruby interprets the snippet as a shell script.

By doing this, your Arkana code generation will be executed everytime you run pod install or pod update.

The only down side of using this strategy is that you wouldn't want to use it if you need to pass in (dynamic) flavors, since it would require you to modify the Podfile on every different flavor you need to build. If that's the case, you should run Arkana before running pod install in your build pipeline, and not use this snippet at all.

References

Did you know?

The word arcanum (pluralized as "arcana", here spelled as "Arkana") came from Latin arcanus, meaning "secret", and entered English as the Dark Ages gave way to the Renaissance.²

Special thanks to @danilobecke for the inspiration and heavy lifting, and to @orta for the creation of https://github.com/orta/cocoapods-keys which this project is based off of.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

To bump the lib's version, run bundle exec rake bump[1.2.3] (replacing the value with the desired version).

To release a new version, make sure the version number in version.rb is the one you want to release (after setting it via bundle exec rake bump as shown above), and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Contributions to Arkana are warmly welcomed. Whether it's bug reports, feature requests, or code contributions, your input is highly valued. Please feel free to submit issues and pull requests with your ideas and I promise to get back to you within 24 hours! 😇

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

For a list of issues worth tackling check out: https://github.com/rogerluan/arkana/issues

Popularity

Explore my other tools

Statused Social Banner

Forget about 'When did release v2.1.3 go live again?' and 'Is the app ready to be tested yet?'

Statused monitors App Store Connect and send you notifications directly on Slack.

Learn more: statused.com

License

This project is open source and covered by a standard 2-clause BSD license. That means you can use (publicly, commercially and privately), modify and distribute this project's content, as long as you mention Roger Oba as the original author of this code and reproduce the LICENSE text inside your app, repository, project or research paper.

Contact

Twitter: @rogerluan_

arkana's People

Contributors

alobaili avatar husseinala avatar jdanthinne avatar orta avatar rogerluan avatar scottymack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arkana's Issues

Add more unit tests for other types of secrets

Add unit tests for "any" type of secret, such as industry well known secret generation algorithms, including handling all types of special characters.

Right now this has only been tested generating secrets for hex, base64 and uuid secrets, of 64-characters long. Examples: how about really long secrets? Non-ascii characters? Secrets with emojis or other unicode characters?

Point of entry: arkana_tests.swift.erb

Make available via Homebrew

Feature request: make available via homebrew. The main reason I am suggesting this is because it would make using Arkana easier when using Xcode cloud.

Bundler is not installed by default on Xcode Cloud and running gem install arkana requires both to specify not the latest version (1.4.0) due to outdated ruby by default on Xcode Cloud, but also requires a workaround since running gem install requires sudo by default. If Arkana was available via homebrew, if I understand correctly, both of these issues could be averted.

I admitably know very little about what it would take do to this, but just throwing out the idea.

Issues with Xcode Build Phases Script

Hi, I find arkana very useful and was successfully to switch between different environment sets.

But when I try to integrate this to Xcode Build Phase:

tmp=${CONFIGURATION#*(}   # remove prefix ending in "("
env=${tmp%)*}   # remove suffix starting with ")"

bundle exec arkana -d ".env.${env}"

I get ERROR /Library/Ruby/Site/2.6.0/rubygems.rb:265:in find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)`

Here is the output of gem environment also in Build Phase:


Showing Recent Messages
RubyGems Environment: - RUBYGEMS VERSION: 3.3.20 - RUBY VERSION: 2.6.10 (2022-04-12 patchlevel 210) [universal.arm64e-darwin22] - INSTALLATION DIRECTORY: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 - USER INSTALLATION DIRECTORY: /Users/johnny/.gem/ruby/2.6.0 - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby - GIT EXECUTABLE: /Applications/Xcode.app/Contents/Developer/usr/bin/git - EXECUTABLE DIRECTORY: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin - SPEC CACHE DIRECTORY: /Users/johnny/.gem/specs - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site - RUBYGEMS PLATFORMS: - ruby - universal-darwin-22 - GEM PATHS: - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 - /Users/johnny/.gem/ruby/2.6.0 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :backtrace => true - :bulk_threshold => 1000 - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/appleinternal/bin - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/appleinternal/bin - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/local/bin - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/local/bin - /Applications/Xcode.app/Contents/Developer/usr/bin - /Applications/Xcode.app/Contents/Developer/usr/local/bin - /usr/local/bin - /usr/bin - /bin - /usr/sbin - /sbin

Im on MacOS 13.0 Xcode 14.0

Number string is converted to int

When I define a variable in my .env file like this:

MyVar = "0001"

This will be translated by arkana into an integer with the trailing zeros being removed.

@inline(__always)
public let myVar: Int = {
    let encoded: [UInt8] = [
        0xa8, 0x5, 0x7, 0xf1
    ]
    return ArkanaKeys.decode(encoded: encoded, cipher: ArkanaKeys.salt)
}()

What I need however is to have the exact same string "0001" when I access myVar in the code. Is this a bug or is there a way to force parsing as string?

Add a feature to only build for a selected environment

We can build for selected flavour using
arkana --flavour snowflake

It would be nice to have feature like
arkana --environment Production

So that we don't need to have every environment keys in our CI and we can just load only production keys in CI and that would be enough to run Arkana on CI

Support monorepo projects better

Right now if someone has a monorepo project (a repo with multiple projects inside), it could be hard to coordinate when each set of secrets should be generated. Perhaps we should have 1 command to generate secrets for all the projects at once, without overriding each others' results (i.e. by specifying different destination folders)

Add hook for env var validation during generation time

This is a nice-to-have: having a hook where users of this gem can write validations to their secrets (in Ruby) during generation time. This is useful if, for instance, you'd like to check that a specific env var shouldn't contain and empty string which would cause your app to crash, or it's expected to be a boolean but it's a string, or any other type of issue that could cause problems during runtime, could be avoided during code generation time.

[Request] Support both Swift and ObjC

Hi there,

I've tried Arkana recently, and it seems to support only Swift.
I considered writing an Obj-C wrapper, but it's impractical since the number of Keys is dynamic, I have to update the Obj-C wrapper every time when the number of Keys changes.

So I'd like to request an improvement that the generated codes support both Swift and ObjC.

Missing package product 'ArkanaKeys' (arkana 1.5.0)

Hello,

I have reset the SPM cache and resolved everything from scratch. I get this error shown:

Missing package product 'ArkanaKeys'

I have updated it via bundler already:

> bundler update
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Fetching rake 13.1.0 (was 13.0.6)
Installing rake 13.1.0 (was 13.0.6)
Using rexml 3.2.6
Fetching public_suffix 5.0.4 (was 5.0.3)
Using rainbow 3.1.1
Using artifactory 3.0.15
Using atomos 0.1.3
Using bundler 2.4.14
Fetching yaml 0.3.0 (was 0.2.1)
Using dotenv 2.8.1
Using jmespath 1.6.2
Fetching aws-partitions 1.853.0 (was 1.828.0)
Using colored2 3.1.2
Using babosa 1.0.4
Using declarative 0.0.20
Using claide 1.1.0
Using digest-crc 0.6.5
Using highline 2.0.3
Using aws-eventstream 1.2.0
Using emoji_regex 3.2.3
Using faraday-em_http 1.0.0
Using faraday-em_synchrony 1.0.0
Using faraday-excon 1.1.0
Using faraday-httpclient 1.0.1
Using multipart-post 2.3.0
Using faraday-net_http_persistent 1.2.0
Using faraday-patron 1.0.0
Using faraday-net_http 1.0.1
Using faraday-retry 1.0.3
Using ruby2_keywords 0.0.5
Using colored 1.2
Using gh_inspector 1.1.3
Using jwt 2.7.1
Using fastimage 2.2.7
Using os 1.1.4
Using httpclient 2.8.3
Using mini_mime 1.1.5
Using faraday-rack 1.0.0
Using uber 0.1.0
Using retriable 3.1.2
Using webrick 1.8.1
Using google-cloud-errors 1.3.1
Using json 2.6.3
Using mini_magick 4.12.0
Using naturally 2.2.1
Using optparse 0.1.1
Using trailblazer-option 0.1.2
Fetching excon 0.104.0 (was 0.103.0)
Using plist 3.7.0
Using security 0.1.3
Using terminal-notifier 2.0.0
Fetching unicode-display_width 2.5.0 (was 2.4.2)
Using rubyzip 2.3.2
Using multi_json 1.15.0
Fetching domain_name 0.6.20231109 (was 0.5.20190701)
Using tty-screen 0.8.1
Using tty-cursor 0.7.1
Using nanaimo 0.3.0
Using rouge 2.0.7
Using CFPropertyList 3.0.6
Fetching aws-sigv4 1.6.1 (was 1.6.0)
Using word_wrap 1.0.0
Using commander 4.6.0
Using faraday-multipart 1.0.4
Using representable 3.2.0
Using simctl 1.6.10
Using tty-spinner 0.9.3
Using xcodeproj 1.23.0
Using xcpretty 0.3.0
Using faraday 1.10.3
Installing yaml 0.3.0 (was 0.2.1)
Using faraday_middleware 1.2.0
Using google-cloud-env 1.6.0
Using xcpretty-travis-formatter 1.0.1
Using google-cloud-core 1.6.0
Installing public_suffix 5.0.4 (was 5.0.3)
Installing aws-partitions 1.853.0 (was 1.828.0)
Fetching arkana 1.5.0 (was 1.4.0)
Installing aws-sigv4 1.6.1 (was 1.6.0)
Installing unicode-display_width 2.5.0 (was 2.4.2)
Using addressable 2.8.5
Using signet 0.18.0
Using googleauth 1.8.1
Fetching google-apis-core 0.11.2 (was 0.11.1)
Using terminal-table 3.0.2
Fetching aws-sdk-core 3.187.0 (was 3.183.1)
Installing domain_name 0.6.20231109 (was 0.5.20190701)
Installing excon 0.104.0 (was 0.103.0)
Using http-cookie 1.0.5
Using faraday-cookie_jar 0.0.7
Installing google-apis-core 0.11.2 (was 0.11.1)
Using google-apis-playcustomapp_v1 0.13.0
Using google-apis-iamcredentials_v1 0.17.0
Fetching google-apis-androidpublisher_v3 0.52.0 (was 0.50.0)
Fetching google-apis-storage_v1 0.29.0 (was 0.19.0)
Installing aws-sdk-core 3.187.0 (was 3.183.1)
Installing google-apis-storage_v1 0.29.0 (was 0.19.0)
Installing google-apis-androidpublisher_v3 0.52.0 (was 0.50.0)
Fetching google-cloud-storage 1.45.0 (was 1.44.0)
Fetching aws-sdk-kms 1.72.0 (was 1.71.0)
Installing google-cloud-storage 1.45.0 (was 1.44.0)
Installing aws-sdk-kms 1.72.0 (was 1.71.0)
Installing arkana 1.5.0 (was 1.4.0)
Fetching aws-sdk-s3 1.137.0 (was 1.135.0)
Installing aws-sdk-s3 1.137.0 (was 1.135.0)
Fetching fastlane 2.217.0 (was 2.216.0)
Installing fastlane 2.217.0 (was 2.216.0)
Bundle updated!

What could be the issue, please?

license compatibility issue: `colorize`

Hi,

Would it be possible to replace colorize dependency with something else (rainbow or other gem)? Colorize uses GPL2 license and that may not be fully compatible with Arkana's license.

Similar issue with colorize - spree/deface#153

Thanks,

Don't generate unnecessary extensions

If you do not have any keys for global_secrets it still generates an unnecessary extension like:

public extension ArkanaKeys {
    struct Global: ArkanaKeysGlobalProtocol {
        public init() {}
    }
}

I presume like wise that if you had no environment_secrets It would also generate similar empty extensions.

You shouldn't generate these useless blocks of code if there are no keys

The key is getting corrupted when it contains '$'

The key is getting corrupted if it contains $.

I store APIKeyStaging="A$QEsdXNWTK0Qc+iSAl" in .env file, generate code and then I see "A+iSAl" as a decrypted value at the runtime.

Arkana v1.3.1.

Are there other special symbols that could corrupt keys?

Arkana fails on CI due to .env file missing, even when env vars are all present in CI

Discussed in #32

Originally posted by mishaherasimov March 17, 2023
I'm currently trying to build a pipeline that creates keys before building the project.
I've imported all keys as environmental variables of the project.

Given these conditions, Arkana fails to generate an SPM package because .env is added to .gitignore.
What would be the correct way to configure Arkana?

CI Environment: Circle CI

Screenshot 2023-03-17 at 2 46 38 PM

I ran arkana… what's the next step?

After I run bundle exec arkana … and the generated SwiftPM package is created, how do I use it?
Can I immediately open my Xcode project and import ArkanaKeys?
How do I include the generated SwiftPM package in my Xcode project?

I think the documentation for Arkana should include answers to all these questions.

Required Ruby version

Hello, I've noticed that this tool require ruby 2.7+, but by default MacOS and bitrise's Xcode stack are using 2.6.x. It's not a big issue to bump it, but for most developers that don't dabble with ruby it will be additional stepping stone while adding Arkana to their projects. Would it be possible to lower requirement?

Failed to load command: arkana - Undefined method capitalize_first_letter

I added arkana to my gem file:
gem 'arkana'

And installed with
bundle install

It appears to be a success. However, when I try to run "bundle exec arkana" in my command line, I get the following error:

bundler: failed to load command: arkana (/Users/jean-baptistebolh/.rbenv/versions/2.7.3/bin/arkana)
NoMethodError: undefined method `capitalize_first_letter' for #<Array:0x0000000155b08f00>
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/models/config.rb:47:in `each'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/models/config.rb:47:in `map'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/models/config.rb:47:in `initialize'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/config_parser.rb:14:in `new'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/config_parser.rb:14:in `parse'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana.rb:16:in `run'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/bin/arkana:8:in `<top (required)>'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/bin/arkana:23:in `load'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/bin/arkana:23:in `<top (required)>'

Difficulty following spm setup instructions

It took me several tries and some research to figure out how to follow the spm setup instructions

Step 1 may be a bit confusing to people as the default hierarchy is ArkanaKeys > ArkanaKeys. The instructions say to select the ArkanaKeys folder, without being specific for which one (it is of course the inner one).

Step 3 was hard to follow because there appears to be an issue that your local package you added above does not show up in the list to choose from unless you quit and reload xcode.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.