Comments (10)
On second thought, maybe we can just skip base64 encoding entirely.
from aws-secrets.
Since awscli is already a prerequisite, I suppose we can assume python is installed, so perhaps this could be replaced with python -m base64 -d
from aws-secrets.
Newer versions of base64
on OS/X supports both -D
and -d
for decoding:
Usage: base64 [-hvDd] [-b num] [-i in_file] [-o out_file]
-h, --help display this message
-Dd, --decode decodes input
-b, --break break encoded string into num character lines
-i, --input input file (default: "-" for stdin)
-o, --output output file (default: "-" for stdout)
from aws-secrets.
Also, can we be certain that every OS will have base64
?
from aws-secrets.
@nicholaides It's a builtin: https://docs.python.org/3/library/base64.html
from aws-secrets.
Sorry-- I meant, the shell command/executable base64
. I was wondering how certain we can be that it's available on every OS. Brian's point that we can rely on Python being installed makes Python seem like a good solution.
from aws-secrets.
It's part of gnu coreutils, so it's on any GNU/linux based distro (just as cat
is). Another option would be to require coreutils on OS/X to get the gnu version (brew install coreutils
)
e.g. on an ubuntu box:
$ dpkg -S /bin/cat
coreutils: /bin/cat
$ dpkg -S /usr/bin/base64
coreutils: /usr/bin/base64
I wouldn't recommend python for this if we didn't already have awscli as a requirement.
from aws-secrets.
What's also interesting is that OS/X (the only outlier) lists lowercase d in the first line of the help message, so this could be called a bug in the OS/X base64
$ /usr/bin/base64 --help
Usage: /usr/bin/base64 [-dhvD] [-b num] [-i in_file] [-o out_file]
-h, --help display this message
-D, --decode decodes input
-b, --break break encoded string into num character lines
-i, --input input file (default: "-" for stdin)
-o, --output output file (default: "-" for stdout)
from aws-secrets.
I can attest @fabriziofortino
Even on Big Sur man base64
-d
-D
--decode Decode incoming Base64 stream into binary data.
from aws-secrets.
This issue just bit me today on Ubuntu 22.04: base64: invalid option -- 'D'
The only supported options are:
base64 --help
Usage: base64 [OPTION]... [FILE]
Base64 encode or decode FILE, or standard input, to standard output.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-d, --decode decode data
-i, --ignore-garbage when decoding, ignore non-alphabet characters
-w, --wrap=COLS wrap encoded lines after COLS character (default 76).
Use 0 to disable line wrapping
--help display this help and exit
--version output version information and exit
The data are encoded as described for the base64 alphabet in RFC 4648.
When decoding, the input may contain newlines in addition to the bytes of
the formal base64 alphabet. Use --ignore-garbage to attempt to recover
from any other non-alphabet bytes in the encoded stream.
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation <https://www.gnu.org/software/coreutils/base64>
or available locally via: info '(coreutils) base64 invocation'
from aws-secrets.
Related Issues (10)
- Check for awscli version HOT 1
- Required AWS permissions HOT 1
- Support multiple profiles
- Remove sudo
- License HOT 1
- Service trusts assume EC2 only HOT 2
- Support multiple regions for init HOT 1
- Env file is larger than 4096 bytes HOT 1
- The unspecified location constraint is incompatible for the region specific endpoint HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-secrets.