Astro-SpaceTrack

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.146		2021-07-06	T. R. Wyant
    Update AMSAT URL.

    Correct generation of 'provides' metadata.  Thanks to Favio Poletti
    for blogging
    https://github.polettix.it/ETOOBUSY/2021/06/15/the-real-pause-workaround/,
    and ultimately to Joel Berger for the pointer to
    https://metacpan.org/pod/CPAN::Meta::Spec#no_index

0.145		2021-03-25	T. R. Wyant
    Allow identity file to have .gpg suffix.  This is for the benefit of
    the vim-gnupg plugin, and potentially other such things.

    Refactor authortest into three, so that I can run the
    optional-modules tests without generating stub files.

0.144		2021-03-07	T. R. Wyant
    Add rt.cpan.org back to bug reporting methods. Long live RT!

    Document retirement of NASA Human Space Flight web site, and its
    effect on this package.

Changes  view on Meta::CPAN


0.096		2017-01-15	T. R. Wyant
  Ditch 'use base'.
    Astro::SpaceTrack is no longer a subclass of Exporter. Instead
    import() was imported into its name space.
    In the case of the inc/ files, 'use base' was replaced by a 'use' of
    the appropriate module, followed by assignment to @ISA.

  Have relevant author tests use identity file.

  Document the use of environment variable CI_GPG to get gpg2 even
    though gpg is also installed.

0.095		2016-11-07	T. R. Wyant
  Support Config::Identity file. Both the file and Config::Identity are
    optional. The file name is spacetrack.id (MSWin32 and VMS) or
    .spacetrack-identity (anything else) in the user's home directory.
    The file itself can be GnuPG encrypted.

  Rod Sladen Iridium status update.

0.094		2016-08-07	T. R. Wyant

inc/My/Module/Recommend.pm  view on Meta::CPAN

} elsif ( $] ge '5.010' ) {
    $is_5_010 = 1;
};

my %misbehaving_os = map { $_ => 1 } qw{ MSWin32 cygwin };

my @optionals = (
    __any( 'Config::Identity'		=> <<'EOD' ),
      This module is used to parse the user's identity file, which
      provides default attribute values, and which can be encrypted with
      gpg2. If you do not intend to make use of the identity file,
      Config::Identity is not needed.
EOD
    __any( 'Browser::Open'		=> <<'EOD' ),
      This module is being phased in as the only supported way to
      display web-based help. If you intend to leave the 'webcmd'
      attribute false, this module is not needed.
EOD
    __any( 'Time::HiRes'		=> <<'EOD' ),
      This module is used for more precise throttling of Space Track
      requests. The code will work without it, but the less precise

lib/Astro/SpaceTrack.pm  view on Meta::CPAN

 SpaceTrack> set with_name 1
 OK
 SpaceTrack> spacetrack special >special.txt
 SpaceTrack> celestrak visual >visual.txt
 SpaceTrack> exit

In either of the above, username and password entry can be omitted if
you have installed L<Config::Identity|Config::Identity>, created an
L<IDENTITY FILE|/IDENTITY FILE> (see below) containing these values, and
set the C<identity> attribute to a true value.  You probably
want to encrypt the identity file, if you have C<gpg2> and C<gpg-agent>.

In practice, it is probably not useful to retrieve data from any source
more often than once every four hours, and in fact daily usually
suffices.

=head1 CAVEAT

Version 0.180 was an emergency release of this module. It was caused by Space
Track deprecating and ultimately revoking the C<'tle_latest'> and
C<'tle'> data classes in favor of C<'gp'> and C<'gp_history'>

lib/Astro/SpaceTrack.pm  view on Meta::CPAN

	VMS	=> sub {
	    my $home = $ENV{HOME} || 'sys$login';
	    return "$home:spacetrack.id";
	},
    );

    sub __identity_file_name {
	my $id_file = ( $id_file_name{$^O} || sub {
		return join '/', $ENV{HOME}, '.spacetrack-identity' }
	)->();
	my $gpg_file = "$id_file.gpg";
	-e $gpg_file
	    and return $gpg_file;
	return $id_file;
    }

}

# This basically duplicates the logic in Config::Identity
sub __identity_file_is_encrypted {
    my $fn = __identity_file_name();
    -B $fn
	and return 1;

lib/Astro/SpaceTrack.pm  view on Meta::CPAN

is, if I found all the places that needed modification.

The default is false (i.e. 0).

=item identity (Boolean)

If this attribute is set to a true value, the C<Astro::SpaceTrack>
object will attempt to load attributes from an identity file. This will
only do anything if the identity file exists and
L<Config::Identity|Config::Identity> is installed. In addition, if the
identity file is encrypted C<gpg2> must be installed and properly
configured. See L<IDENTITY FILE|/IDENTITY FILE> below for details of the
identity file.

I have found that C<gpg> does not seem to work nicely, even though
L<Config::Identity|Config::Identity> prefers it to C<gpg2> if both are
present. The L<Config::Identity|Config::Identity> documentation says
that you can override this by setting environment variable C<CI_GPG>
to the executable you want used.

If this attribute is unspecified (to C<new()> or specified as C<undef>
(to C<new()> or C<set()>), the value of environment variable
C<SPACETRACK_IDENTITY> will be used as the new value.

When a new object is instantiated, the identity is processed first; in
this way attribute values that come from the environment or are

lib/Astro/SpaceTrack.pm  view on Meta::CPAN

=back

=head1 IDENTITY FILE

This is a L<Config::Identity|Config::Identity> file which specifies the
username and password values for the user. This file is stored in the
user's home directory, and is F<spacetrack.id> under C<MSWin32> or
C<VMS>, or F<.spacetrack-identity> under any other operating system.

If desired, the file can be encrypted using GPG; in this case, to be
useful, C<gpg> and C<gpg-agent> must be installed and properly
configured. Because of implementation details in
L<Config::Identity|Config::Identity>, you may need to either ensure that
C<gpg> is not in your C<PATH>, or set the C<CI_GPG> environment variable
to the path to C<gpg2>. The encrypted file can optionally have C<.gpg>
appended to its name for the convenience of users of the vim-gnupg
plugin and similar software. If the identity file exists both with and
without the C<.gpg> suffix, the suffixed version will be used.

Note that this file is normally read only once during the life of the
Perl process, and the result cached. The username and password that are
set when C<identity> becomes true come from the cache. If you want a
running script to see new identity file information you must call static
method C<flush_identity_cache()>.

=head1 GLOBALS

The following globals modify the behaviour of this class. If you modify



( run in 0.737 second using v1.01-cache-2.11-cpan-e1769b4cff6 )