Skip to content

Commit

Permalink
fix: fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikRevich committed Oct 17, 2024
1 parent 1d952d4 commit a46d75a
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 318 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@

## General Information

An object storage with support of **S3** and **Google Cloud Storage** and without vendor limitations.
An object storage with support of **S3** and without vendor limitations.

Features:
* Easy-to-use well-designed API
* Ignores **S3** and **Google Cloud Storage** limitations(**file size** and **performance**) making interaction with storage vendors seamless
* Ignores **S3** limitations(**file size** and **performance**) making interaction with storage vendors seamless
* Opportunity to work with different vendors using the same **ObjectStorage** instance
* Data processing optimizations
* Excessive monitoring opportunities
* Configurable data backups per vendor in the same workspace
* Makes user interaction similar to filesystem

![](./docs/high-level-design.png)

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.objectstorage.converter;

import com.opencsv.bean.CsvToBeanBuilder;
import com.objectstorage.exception.SecretsConversionException;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;

/** Represents cloud provider secrets converter */
public class SecretsConverter {
/**
* Converts given credentials CSV file to a certain object. Exposed as a static method to be used
* with Terraform command definitions.
*
* @param content given file content to be processed.
* @return converted credentials.
* @throws SecretsConversionException if any operation in conversion flow failed.
*/
@SuppressWarnings("unchecked")
public static <T> T convert(Class<T> obj, String content) throws SecretsConversionException {
try {
return (T)
new CsvToBeanBuilder(
new BufferedReader(
new InputStreamReader(new ByteArrayInputStream(content.getBytes()))))
.withType(obj.getDeclaredConstructor().newInstance().getClass())
.withIgnoreLeadingWhiteSpace(true)
.build()
.parse()
.get(1);
} catch (InstantiationException
| IllegalAccessException
| NoSuchMethodException
| InvocationTargetException e) {
throw new SecretsConversionException(e.getMessage());
}
}
}
Loading

0 comments on commit a46d75a

Please sign in to comment.