vault-key 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/native/vault-key.darwin.h +76 -0
- data/lib/native/vault-key.linux.h +76 -0
- data/lib/vault-key.rb +19 -0
- metadata +74 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ec42e57b2ea6e4d7a5688a76dc33d2f343647a1b
|
4
|
+
data.tar.gz: 3a1754b6a2a741b310ed3c06cba783df19246b14
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 66cf9f39a67d00f4d875d18676a4fe724f1d09ee54ce297914ad48b42d3df33ce363afda5b894c591607df93bc8c2e80ce2b1f5184bdc72936206ce250c96854
|
7
|
+
data.tar.gz: c6bc2a25024c487af8ed868f85e1834e528308b9c956410e2c177b7dadd3b3c960d3b2de7973cb44a397e2ad80c33e14953cfa531a4bc5b24df031fe53bf579b
|
@@ -0,0 +1,76 @@
|
|
1
|
+
/* Code generated by cmd/cgo; DO NOT EDIT. */
|
2
|
+
|
3
|
+
/* package command-line-arguments */
|
4
|
+
|
5
|
+
|
6
|
+
#line 1 "cgo-builtin-export-prolog"
|
7
|
+
|
8
|
+
#include <stddef.h> /* for ptrdiff_t below */
|
9
|
+
|
10
|
+
#ifndef GO_CGO_EXPORT_PROLOGUE_H
|
11
|
+
#define GO_CGO_EXPORT_PROLOGUE_H
|
12
|
+
|
13
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
14
|
+
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
15
|
+
#endif
|
16
|
+
|
17
|
+
#endif
|
18
|
+
|
19
|
+
/* Start of preamble from import "C" comments. */
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
/* End of preamble from import "C" comments. */
|
25
|
+
|
26
|
+
|
27
|
+
/* Start of boilerplate cgo prologue. */
|
28
|
+
#line 1 "cgo-gcc-export-header-prolog"
|
29
|
+
|
30
|
+
#ifndef GO_CGO_PROLOGUE_H
|
31
|
+
#define GO_CGO_PROLOGUE_H
|
32
|
+
|
33
|
+
typedef signed char GoInt8;
|
34
|
+
typedef unsigned char GoUint8;
|
35
|
+
typedef short GoInt16;
|
36
|
+
typedef unsigned short GoUint16;
|
37
|
+
typedef int GoInt32;
|
38
|
+
typedef unsigned int GoUint32;
|
39
|
+
typedef long long GoInt64;
|
40
|
+
typedef unsigned long long GoUint64;
|
41
|
+
typedef GoInt64 GoInt;
|
42
|
+
typedef GoUint64 GoUint;
|
43
|
+
typedef __SIZE_TYPE__ GoUintptr;
|
44
|
+
typedef float GoFloat32;
|
45
|
+
typedef double GoFloat64;
|
46
|
+
typedef float _Complex GoComplex64;
|
47
|
+
typedef double _Complex GoComplex128;
|
48
|
+
|
49
|
+
/*
|
50
|
+
static assertion to make sure the file is being used on architecture
|
51
|
+
at least with matching size of GoInt.
|
52
|
+
*/
|
53
|
+
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
54
|
+
|
55
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
56
|
+
typedef _GoString_ GoString;
|
57
|
+
#endif
|
58
|
+
typedef void *GoMap;
|
59
|
+
typedef void *GoChan;
|
60
|
+
typedef struct { void *t; void *v; } GoInterface;
|
61
|
+
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
62
|
+
|
63
|
+
#endif
|
64
|
+
|
65
|
+
/* End of boilerplate cgo prologue. */
|
66
|
+
|
67
|
+
#ifdef __cplusplus
|
68
|
+
extern "C" {
|
69
|
+
#endif
|
70
|
+
|
71
|
+
|
72
|
+
extern char* GetSecrets(char* p0);
|
73
|
+
|
74
|
+
#ifdef __cplusplus
|
75
|
+
}
|
76
|
+
#endif
|
@@ -0,0 +1,76 @@
|
|
1
|
+
/* Code generated by cmd/cgo; DO NOT EDIT. */
|
2
|
+
|
3
|
+
/* package command-line-arguments */
|
4
|
+
|
5
|
+
|
6
|
+
#line 1 "cgo-builtin-export-prolog"
|
7
|
+
|
8
|
+
#include <stddef.h> /* for ptrdiff_t below */
|
9
|
+
|
10
|
+
#ifndef GO_CGO_EXPORT_PROLOGUE_H
|
11
|
+
#define GO_CGO_EXPORT_PROLOGUE_H
|
12
|
+
|
13
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
14
|
+
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
15
|
+
#endif
|
16
|
+
|
17
|
+
#endif
|
18
|
+
|
19
|
+
/* Start of preamble from import "C" comments. */
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
/* End of preamble from import "C" comments. */
|
25
|
+
|
26
|
+
|
27
|
+
/* Start of boilerplate cgo prologue. */
|
28
|
+
#line 1 "cgo-gcc-export-header-prolog"
|
29
|
+
|
30
|
+
#ifndef GO_CGO_PROLOGUE_H
|
31
|
+
#define GO_CGO_PROLOGUE_H
|
32
|
+
|
33
|
+
typedef signed char GoInt8;
|
34
|
+
typedef unsigned char GoUint8;
|
35
|
+
typedef short GoInt16;
|
36
|
+
typedef unsigned short GoUint16;
|
37
|
+
typedef int GoInt32;
|
38
|
+
typedef unsigned int GoUint32;
|
39
|
+
typedef long long GoInt64;
|
40
|
+
typedef unsigned long long GoUint64;
|
41
|
+
typedef GoInt64 GoInt;
|
42
|
+
typedef GoUint64 GoUint;
|
43
|
+
typedef __SIZE_TYPE__ GoUintptr;
|
44
|
+
typedef float GoFloat32;
|
45
|
+
typedef double GoFloat64;
|
46
|
+
typedef float _Complex GoComplex64;
|
47
|
+
typedef double _Complex GoComplex128;
|
48
|
+
|
49
|
+
/*
|
50
|
+
static assertion to make sure the file is being used on architecture
|
51
|
+
at least with matching size of GoInt.
|
52
|
+
*/
|
53
|
+
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
54
|
+
|
55
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
56
|
+
typedef _GoString_ GoString;
|
57
|
+
#endif
|
58
|
+
typedef void *GoMap;
|
59
|
+
typedef void *GoChan;
|
60
|
+
typedef struct { void *t; void *v; } GoInterface;
|
61
|
+
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
62
|
+
|
63
|
+
#endif
|
64
|
+
|
65
|
+
/* End of boilerplate cgo prologue. */
|
66
|
+
|
67
|
+
#ifdef __cplusplus
|
68
|
+
extern "C" {
|
69
|
+
#endif
|
70
|
+
|
71
|
+
|
72
|
+
extern char* GetSecrets(char* p0);
|
73
|
+
|
74
|
+
#ifdef __cplusplus
|
75
|
+
}
|
76
|
+
#endif
|
data/lib/vault-key.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'ffi'
|
2
|
+
require 'json'
|
3
|
+
require 'OS'
|
4
|
+
|
5
|
+
module VaultNative
|
6
|
+
extend FFI::Library
|
7
|
+
|
8
|
+
sharedObjectPath = OS.linux? ? "./native/vault-key.linux.so" : "./native/vault-key.darwin.so"
|
9
|
+
|
10
|
+
ffi_lib File.expand_path(sharedObjectPath, File.dirname(__FILE__))
|
11
|
+
attach_function :GetSecrets, [:string], :string
|
12
|
+
end
|
13
|
+
|
14
|
+
class VaultKey
|
15
|
+
def self.getSecrets(secrets)
|
16
|
+
secretsData = VaultNative.GetSecrets(JSON.generate(secrets))
|
17
|
+
JSON.parse(secretsData)
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vault-key
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- TeamSnap SREs
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-10-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ffi
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.11.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.11.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: os
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.1
|
41
|
+
description: A gem to integrate Vault with GCP auth
|
42
|
+
email: sre@teamsnap.com
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- lib/native/vault-key.darwin.h
|
48
|
+
- lib/native/vault-key.linux.h
|
49
|
+
- lib/vault-key.rb
|
50
|
+
homepage: https://rubygems.org/gems/vault-key
|
51
|
+
licenses:
|
52
|
+
- MIT
|
53
|
+
metadata: {}
|
54
|
+
post_install_message:
|
55
|
+
rdoc_options: []
|
56
|
+
require_paths:
|
57
|
+
- lib
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
requirements: []
|
69
|
+
rubyforge_project:
|
70
|
+
rubygems_version: 2.5.2.3
|
71
|
+
signing_key:
|
72
|
+
specification_version: 4
|
73
|
+
summary: Vault with GCP auth
|
74
|
+
test_files: []
|