summaryrefslogtreecommitdiff
path: root/python-aws-creds.spec
blob: fa5e8a3eaf8f99b3ceb40f099cf4f08713cbba1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
%global _empty_manifest_terminate_build 0
Name:		python-aws-creds
Version:	2.0.1
Release:	1
Summary:	Easily switch between AWS Credential profiles.
License:	MIT License
URL:		https://github.com/HammoTime/aws-creds
Source0:	https://mirrors.aliyun.com/pypi/web/packages/c1/ca/56aac32bcd2f014126f0bafd9e2c88427b484138294df7712e1f650dc812/aws-creds-2.0.1.tar.gz
BuildArch:	noarch

Requires:	python3-boto3
Requires:	python3-click

%description
# AWS Credential Picker (aws-creds)
Makes it easier to use multiple AWS accounts when you don't have SSO available. You can easily save multiple profiles, and then log into them with an simple set of commands.

## Installing

This utility is available in PyPi and can be installed by running:
```
python3 -m pip install aws-creds
```

## Usage

```
MacBook-Pro:aws-creds HammoTime$ aws-creds --help
Usage: aws-creds [OPTIONS] COMMAND [ARGS]...

  aws-creds makes it easier to use multiple AWS accounts when you don't have
  SSO available.  You can easily save multiple profiles, and then log into
  them with an simple set of commands.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  add      Adds a new credential profile.
  default  Used to set the defaults for output type and region.
  login    Sets the user's AWS credentials to the selected profile.
  logout   Deletes user's current AWS credentials.
  ls       Lists all of the saved profiles.
  rm       Deletes the selected profile.
  role     Used to login using an assumed role.
  rotate   Automatically rotates your access keys.
  status   Prints out information about the credential that is currently in...
  update   Updates the selected profile with the new values.
```

## Commands

The following commands are available within the AWS Credential Picker.

1. ```add```: Add a new credential.
2. ```rm```: Remove a credential.
3. ```ls```: List all the saved credentials.
4. ```login```: Login using a credential.
5. ```logout```: Remove all of the files used by the aws-cli in ~/.aws.
6. ```status```: Print details about the current session (account/user).
7. ```update```: Updates the selected profile with new values.
8. ```rotate```: Rotates your Access Key if you have a spare slot available.
9. ```default```: Used to manage default region and output type.
    1. ```get```: Prints out the default region and output type.
    2. ```set```: Sets the default region and output type.
10. ```role```: Used to manage roles that can be assumed from the cli.
    1. ```add```: Adds a role.
    2. ```assume```: Assumes a saved role.
    3. ```ls```: Lists all roles available to be assumed.
    4. ```rm```: Removes an assumed role permanently from aws-cred config.
    5. ```unassume```: Unassumes a role, switching back to source account.

## Options

The following options are available within the AWS Credential Picker.

1. ```--help```: Show the help screen.
2. ```--version```: Print version details.

## How it Works
The AWS Credential Picker is quite simple in it's design. Instead of storing details in the credentials file - which can prove difficult to use with lots of profiles - we store them in a custom JSON file. When you ```login```, you're actually doing is creating the ```credentials``` and the ```config``` file in ```~/.aws```. When you ```logout```, these files are being deleted.

The reason this was created is that some AWS Utilities and 3rd Party Tools REALLY do not like it if you have multiple profiles and do not treat environment variables correctly. By always having a single credential set, utilities will ALWAYS work.

This script also provides an update on how old your Access Key is and advises you when to rotate them.

## Dependencies

- [boto3](https://pypi.org/project/boto3/)
- [click](https://pypi.org/project/click/)



%package -n python3-aws-creds
Summary:	Easily switch between AWS Credential profiles.
Provides:	python-aws-creds
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-aws-creds
# AWS Credential Picker (aws-creds)
Makes it easier to use multiple AWS accounts when you don't have SSO available. You can easily save multiple profiles, and then log into them with an simple set of commands.

## Installing

This utility is available in PyPi and can be installed by running:
```
python3 -m pip install aws-creds
```

## Usage

```
MacBook-Pro:aws-creds HammoTime$ aws-creds --help
Usage: aws-creds [OPTIONS] COMMAND [ARGS]...

  aws-creds makes it easier to use multiple AWS accounts when you don't have
  SSO available.  You can easily save multiple profiles, and then log into
  them with an simple set of commands.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  add      Adds a new credential profile.
  default  Used to set the defaults for output type and region.
  login    Sets the user's AWS credentials to the selected profile.
  logout   Deletes user's current AWS credentials.
  ls       Lists all of the saved profiles.
  rm       Deletes the selected profile.
  role     Used to login using an assumed role.
  rotate   Automatically rotates your access keys.
  status   Prints out information about the credential that is currently in...
  update   Updates the selected profile with the new values.
```

## Commands

The following commands are available within the AWS Credential Picker.

1. ```add```: Add a new credential.
2. ```rm```: Remove a credential.
3. ```ls```: List all the saved credentials.
4. ```login```: Login using a credential.
5. ```logout```: Remove all of the files used by the aws-cli in ~/.aws.
6. ```status```: Print details about the current session (account/user).
7. ```update```: Updates the selected profile with new values.
8. ```rotate```: Rotates your Access Key if you have a spare slot available.
9. ```default```: Used to manage default region and output type.
    1. ```get```: Prints out the default region and output type.
    2. ```set```: Sets the default region and output type.
10. ```role```: Used to manage roles that can be assumed from the cli.
    1. ```add```: Adds a role.
    2. ```assume```: Assumes a saved role.
    3. ```ls```: Lists all roles available to be assumed.
    4. ```rm```: Removes an assumed role permanently from aws-cred config.
    5. ```unassume```: Unassumes a role, switching back to source account.

## Options

The following options are available within the AWS Credential Picker.

1. ```--help```: Show the help screen.
2. ```--version```: Print version details.

## How it Works
The AWS Credential Picker is quite simple in it's design. Instead of storing details in the credentials file - which can prove difficult to use with lots of profiles - we store them in a custom JSON file. When you ```login```, you're actually doing is creating the ```credentials``` and the ```config``` file in ```~/.aws```. When you ```logout```, these files are being deleted.

The reason this was created is that some AWS Utilities and 3rd Party Tools REALLY do not like it if you have multiple profiles and do not treat environment variables correctly. By always having a single credential set, utilities will ALWAYS work.

This script also provides an update on how old your Access Key is and advises you when to rotate them.

## Dependencies

- [boto3](https://pypi.org/project/boto3/)
- [click](https://pypi.org/project/click/)



%package help
Summary:	Development documents and examples for aws-creds
Provides:	python3-aws-creds-doc
%description help
# AWS Credential Picker (aws-creds)
Makes it easier to use multiple AWS accounts when you don't have SSO available. You can easily save multiple profiles, and then log into them with an simple set of commands.

## Installing

This utility is available in PyPi and can be installed by running:
```
python3 -m pip install aws-creds
```

## Usage

```
MacBook-Pro:aws-creds HammoTime$ aws-creds --help
Usage: aws-creds [OPTIONS] COMMAND [ARGS]...

  aws-creds makes it easier to use multiple AWS accounts when you don't have
  SSO available.  You can easily save multiple profiles, and then log into
  them with an simple set of commands.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  add      Adds a new credential profile.
  default  Used to set the defaults for output type and region.
  login    Sets the user's AWS credentials to the selected profile.
  logout   Deletes user's current AWS credentials.
  ls       Lists all of the saved profiles.
  rm       Deletes the selected profile.
  role     Used to login using an assumed role.
  rotate   Automatically rotates your access keys.
  status   Prints out information about the credential that is currently in...
  update   Updates the selected profile with the new values.
```

## Commands

The following commands are available within the AWS Credential Picker.

1. ```add```: Add a new credential.
2. ```rm```: Remove a credential.
3. ```ls```: List all the saved credentials.
4. ```login```: Login using a credential.
5. ```logout```: Remove all of the files used by the aws-cli in ~/.aws.
6. ```status```: Print details about the current session (account/user).
7. ```update```: Updates the selected profile with new values.
8. ```rotate```: Rotates your Access Key if you have a spare slot available.
9. ```default```: Used to manage default region and output type.
    1. ```get```: Prints out the default region and output type.
    2. ```set```: Sets the default region and output type.
10. ```role```: Used to manage roles that can be assumed from the cli.
    1. ```add```: Adds a role.
    2. ```assume```: Assumes a saved role.
    3. ```ls```: Lists all roles available to be assumed.
    4. ```rm```: Removes an assumed role permanently from aws-cred config.
    5. ```unassume```: Unassumes a role, switching back to source account.

## Options

The following options are available within the AWS Credential Picker.

1. ```--help```: Show the help screen.
2. ```--version```: Print version details.

## How it Works
The AWS Credential Picker is quite simple in it's design. Instead of storing details in the credentials file - which can prove difficult to use with lots of profiles - we store them in a custom JSON file. When you ```login```, you're actually doing is creating the ```credentials``` and the ```config``` file in ```~/.aws```. When you ```logout```, these files are being deleted.

The reason this was created is that some AWS Utilities and 3rd Party Tools REALLY do not like it if you have multiple profiles and do not treat environment variables correctly. By always having a single credential set, utilities will ALWAYS work.

This script also provides an update on how old your Access Key is and advises you when to rotate them.

## Dependencies

- [boto3](https://pypi.org/project/boto3/)
- [click](https://pypi.org/project/click/)



%prep
%autosetup -n aws-creds-2.0.1

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-aws-creds -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 2.0.1-1
- Package Spec generated