https://github.com/chrynan/redacted

Kotlin components to redact sensitive information from `toString` output.

https://github.com/chrynan/redacted

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary

Keywords

kotlin kotlin-library kotlin-multi-platform kotlin-multiplatform kotlin-multiplatform-library redact redacted redaction
Last synced: 9 months ago · JSON representation

Repository

Kotlin components to redact sensitive information from `toString` output.

Basic Info
  • Host: GitHub
  • Owner: chRyNaN
  • License: apache-2.0
  • Language: Kotlin
  • Default Branch: main
  • Homepage:
  • Size: 78.1 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
kotlin kotlin-library kotlin-multi-platform kotlin-multiplatform kotlin-multiplatform-library redact redacted redaction
Created about 5 years ago · Last pushed almost 5 years ago
Metadata Files
Readme License

README.md

redacted

Components to redact sensitive information from toString output.
GitHub tag (latest by date)

This library was inspired by this article that I was introduced to by a coworker. I often find myself needing this functionality in projects, so I decided to advance the functionality and make it a reusable library.

```kotlin data class Credentials( val email: String, val password: RedactedProperty )

val credentials = Credentials( email = "test@example.com", password = RedactedProperty(value = "jhdgldfi248nd!39d?") ) ```

Using the library

Simply use the RedactedProperty in place of any property that contains sensitive information that should not be printed out.

kotlin data class Credentials( val email: String, val password: RedactedProperty<String> )

To obtain an instance of a RedactedProperty, just use the constructor:

kotlin RedactedProperty(value = "jhdgldfi248nd!39d?")

To override the default value that is printed when toString is called on the RedactedProperty, provide the redactedString value:

kotlin RedactedProperty( value = "jhdgldfi248nd!39d?", redactedString = "******" )

To specify an amount of times the redactedString value should be repeated when the toString function is called, provide the repeatCount value (which defaults to RepeatCount.Exact(count = 1)):

```kotlin RedactedProperty( value = "jhdgldfi248nd!39d?", redactedString = "*", repeatCount = RepeatCount.MatchLength )

RedactedProperty( value = "jhdgldfi248nd!39d?", redactedString = "*", repeatCount = RepeatCount.Exact(count = 5) ) ```

Note: that the redacted property can still be printed out and obtained if explicitly calling the toString function on the RedactedProperty.value property.

Building the library

The library is provided through Repsy.io. Checkout the releases page to get the latest version.
GitHub tag (latest by date)

Repository

groovy repositories { maven { url = "https://repo.repsy.io/mvn/chrynan/public" } }

Dependencies

Core:

groovy implementation "com.chrynan.redacted:redacted-core:VERSION"

Serialization:

groovy implementation "com.chrynan.redacted:redacted-serialization:VERSION"

Documentation

More detailed documentation is available in the docs folder. The entry point to the documentation can be found here.

License

``` Copyright 2021 chRyNaN

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```

Owner

  • Name: Christopher
  • Login: chRyNaN
  • Kind: user
  • Location: Austin, TX
  • Company: Starry

GitHub Events

Total
Last Year

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 8
  • Total Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Chris c****n@s****m 8
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago


Dependencies

.github/workflows/greetings.yml actions
  • actions/first-interaction v1 composite
redacted-core/build.gradle maven
  • org.jetbrains.kotlin:kotlin-stdlib-common * implementation
  • org.jetbrains.kotlinx:kotlinx-serialization-json 1.2.1 implementation