sty_shared

package
v2024.6.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 24 Imported by: 1

Documentation

Overview

Package sty_shared

This is the STY-Holdings shared services

NOTES:

None

COPYRIGHT & WARRANTY:

Copyright (c) 2022 STY-Holdings, inc
All rights reserved.

This software is the confidential and proprietary information of STY-Holdings, Inc.
Use is subject to license terms.

Unauthorized copying of this file, via any medium is strictly prohibited.

Proprietary and confidential

Written by <Replace with FULL_NAME> / syacko
STY-Holdings, Inc.
support@sty-holdings.com
www.sty-holdings.com

01-2024
USA

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Package sty_shared

This is the STY-Holdings shared services

NOTES:

None

COPYRIGHT & WARRANTY:

Copyright (c) 2022 STY-Holdings, inc
All rights reserved.

This software is the confidential and proprietary information of STY-Holdings, Inc.
Use is subject to license terms.

Unauthorized copying of this file, via any medium is strictly prohibited.

Proprietary and confidential

Written by Scott Yacko / syacko
STY-Holdings, Inc.
support@sty-holdings.com
www.sty-holdings.com

01-2024
USA

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Package sty-shared

This is the STY-Holdings shared services

NOTES:

None

COPYRIGHT & WARRANTY:

Copyright (c) 2022 STY-Holdings, inc
All rights reserved.

This software is the confidential and proprietary information of STY-Holdings, Inc.
Use is subject to license terms.

Unauthorized copying of this file, via any medium is strictly prohibited.

Proprietary and confidential

Written by <Replace with FULL_NAME> / syacko
STY-Holdings, Inc.
support@sty-holdings.com
www.sty-holdings.com

01-2024
USA

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientId added in v2024.6.17

func GetClientId(sessionPtr *AWSSession) string

GetClientId returns the client ID stored in the sessionPtr.

Customer Messages: None Errors: None Verifications: None

func GetId added in v2024.5.8

func GetId(
	sessionPtr *AWSSession,
	region, userPoolId string,
) (
	identityId string,
	errorInfo pi.ErrorInfo,
)

GetId - will return System Manager parameters. WithDecryption is assumed. The variables 'region' and 'userPoolId' are option and are only used when sessionPtr values are empty. The variable 'identityId' is only needed if sessionPtr is nil.

Customer Messages: None
Errors: None
Verifications: None

func GetIdentityCredentials added in v2024.5.8

func GetIdentityCredentials(
	sessionPtr *AWSSession,
	identityId string,

) (
	identityIdCredentials aws.Credentials,
	errorInfo pi.ErrorInfo,
)

GetIdentityCredentials - will return AWS temporary credentials. The variables 'identityId' is option and are only used when sessionPtr values are empty. The variable 'identityIdCredentials' is only needed if sessionPtr is nil.

Customer Messages: None
Errors: None
Verifications: None

func GetParameters added in v2024.5.4

func GetParameters(
	sessionPtr *AWSSession,
	ssmParameters ...string,
) (
	parametersOutput awsSSM.GetParametersOutput,
	errorInfo pi.ErrorInfo,
)

GetParameters - will return System Manager parameters. WithDecryption is assumed.

Customer Messages: None
Errors: None
Verifications: None

func Login added in v2024.5.0

func Login(
	loginType, username string,
	password *string,
	sessionPtr *AWSSession,
) (
	errorInfo pi.ErrorInfo,
)

Login - authenticates the user with the provided login type, username, and password. It stores the tokens in the sessionPtr and any parameters returned from GetParameters

Customer Messages: None Errors: None Verifications: None

func NewCognitoLogin added in v2024.5.0

func NewCognitoLogin(
	username, userPoolId, clientId string,
	password *string,
	clientSecret *string,
) (
	*cognitoLogin,
	pi.ErrorInfo,
)

NewCognitoLogin - creates a CognitoLogin object. If you have a clientSecret, we use a pointer so there is only one place in memory (Security).

Customer Messages: None
Errors: None
Verifications: None

func ParseAWSJWT added in v2024.5.3

func ParseAWSJWT(
	sessionPtr *AWSSession,
	tokenType, token string,
) (
	claims jwt.Claims,
	tokenValuePtr *jwt.Token,
	errorInfo pi.ErrorInfo,
)

ParseAWSJWT - will return the claims, if any, or an err if the AWS JWT is invalid. This will parse ID and Access tokens. Refresh token are not support and nothing is returned.

Customer Messages: None
Errors: None
Verifications: None

Types

type AWSSession added in v2024.5.0

type AWSSession struct {
	// contains filtered or unexported fields
}

func NewAWSConfig added in v2024.5.0

func NewAWSConfig(environment string) (
	sessionPtr *AWSSession,
	errorInfo pi.ErrorInfo,
)

NewAWSConfig - reads the SDKs default external configurations, and populates an AWS Config with the values from the external configurations.

Customer Messages: None
Errors: ErrEnvironmentInvalid, anything awsConfig.LoadDefaultConfig or getPublicKeySet returns,
Verifications: None

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL