Skip to content

Commit

Permalink
Bump version to v0.2.0.0 (#13)
Browse files Browse the repository at this point in the history
* Bump version

* Update cabal file

* Update badge

* Update documentation

* Finalise release
  • Loading branch information
oscar-h64 authored Jul 1, 2020
1 parent e9289af commit 4949171
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.stack-work/

*.tar.gz
13 changes: 13 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Change Log:

## v0.2.0.0:
- `authenticate` function now returns `MonadIO m => m PamRetCode` rather than `IO (Either Int ())`
- `authSuccess :: PamRetCode -> Bool` added which checks if the given `PamRetCode` is `PamSuccess` or not
- `whenSuccess :: MonadIO m => PamRetCode -> m PamRetCode -> m PamRetCode` added, which returns the second argument if the given response code is `PamSuccess`, otherwise it returns the given response code (useful for continuing only if the PAM action succeeded).
- `pamCodeToMessage`, `pamCodeToCDefine` and `pamCodeDetails` now take a `PamRetCode` rather than an `Int`
- `checkAccount` function has now been implemented
- Switched to PVP versioning
- Some documentation added

## v0.1:
Initial release
45 changes: 26 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
# pam-haskell
# pam

Haskell bindings for PAM. This is a fork of [Evgeny Tarasov's package on Hackage](https://hackage.haskell.org/package/pam) with the changes listed below. Haddock documentation is available at [https://oscar-h64.github.io/pam-haskell/](https://oscar-h64.github.io/pam-haskell/)
![Haskell CI](https://github.com/oscar-h64/pam-haskell/workflows/Haskell%20CI/badge.svg)
![Hackage](https://img.shields.io/hackage/v/pam.svg)

##### Implemented Changes:
- `authenticate` function now returns `MonadIO m => m PamRetCode` rather than `IO (Either Int ())`
- `authSuccess :: PamRetCode -> Bool` added which checks if the given `PamRetCode` is `PamSuccess` or not
- `whenSuccess :: MonadIO m => PamRetCode -> m PamRetCode -> m PamRetCode` added, which returns the second argument if the given response code is `PamSuccess`, otherwise it returns the given response code (useful for continuing only if the PAM action succeeded).
- `pamCodeToMessage`, `pamCodeToCDefine` and `pamCodeDetails` now take a `PamRetCode` rather than an `Int`
- `checkAccount` function has now been implemented

##### Planned Changes:
- Document and refactoring the code (started)
- Add ability to give multiple passwords (for 2FA systems) (see [#2](https://github.com/oscar-h64/pam-haskell/issues/2))
- Add functions that do the prompting rather than being given details - useful as if a program using the library is intended to be distributed the number of prompts will not be known (see [#3](https://github.com/oscar-h64/pam-haskell/issues/3))
- Add functions to allow writing PAM modules in Haskell (see [#8](https://github.com/oscar-h64/pam-haskell/issues/8))

## Contributing:

See [here](CONTRIBUTING.md) for more information
Haskell bindings for PAM. Note that this does not currently include the required bindings to write PAM modules

## Usage:

Expand All @@ -33,4 +19,25 @@ checkAccount "system-auth" "test"

If the operation was successful then `PamSuccess` will be returned, otherwise `PamCode a`, where `a` represents the reason for the failure.

`pamCodeToMessage`, `pamCodeToCDefine` and `pamCodeDetails` can be used to get further details about the response, and `isSuccess` can be used to check if the operation was successful. See the [Haddock documentation](https://oscar-h64.github.io/pam-haskell/System-Posix-PAM.html) for more details on these functions.
`pamCodeToMessage`, `pamCodeToCDefine` and `pamCodeDetails` can be used to get further details about the response, and `isSuccess` can be used to check if the operation was successful. See the Haddock documentation for more details on these functions.

## Documentation:

The documentation is available on [Hackage](https://hackage.haskell.org/package/pam)

## Changes in v0.2.0.0:
- `authenticate` function now returns `MonadIO m => m PamRetCode` rather than `IO (Either Int ())`
- `authSuccess :: PamRetCode -> Bool` added which checks if the given `PamRetCode` is `PamSuccess` or not
- `whenSuccess :: MonadIO m => PamRetCode -> m PamRetCode -> m PamRetCode` added, which returns the second argument if the given response code is `PamSuccess`, otherwise it returns the given response code (useful for continuing only if the PAM action succeeded).
- `pamCodeToMessage`, `pamCodeToCDefine` and `pamCodeDetails` now take a `PamRetCode` rather than an `Int`
- `checkAccount` function has now been implemented

## Planned Changes:
- Document and refactoring the code (started)
- Add ability to give multiple passwords (for 2FA systems) (see [#2](https://github.com/oscar-h64/pam-haskell/issues/2))
- Add functions that do the prompting rather than being given details - useful as if a program using the library is intended to be distributed the number of prompts will not be known (see [#3](https://github.com/oscar-h64/pam-haskell/issues/3))
- Add functions to allow writing PAM modules in Haskell (see [#8](https://github.com/oscar-h64/pam-haskell/issues/8))

## Contributing:

See [here](https://github.com/oscar-h64/pam-haskell/blob/master/CONTRIBUTING.md) for more information
61 changes: 37 additions & 24 deletions pam.cabal
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
Name: pam
Version: 0.1
Cabal-Version: >= 1.2.3
Build-type: Simple
License: BSD3
License-File: LICENSE
Copyright: Copyright (c) 2011 Evgeny Tarasov
Maintainer: [email protected]
Stability: alpha
Synopsis: Haskell binding for C PAM API
Description: This package provides PAM interface for Haskell programs. It contains subset of C PAM API bindings. The bindings don't include functions for writing PAM modules.
Category: System
Tested-with: GHC==6.12.3
Extra-source-files: Setup.hs
cabal-version: 3.0
name: pam
version: 0.2.0.0
build-type: Simple
license: BSD-3-Clause
license-file: LICENSE
copyright: (c) 2011 Evgeny Tarasov
(c) 2020 Oscar Harris
author: Evgeny Tarasov <[email protected]>
maintainer: Oscar Harris <[email protected]>
stability: provisional
synopsis: Haskell binding for C PAM API
description: This package provides PAM interface for Haskell programs. See the README on GitHub at <Please see the README on GitHub at <https://github.com/oscar-h64/pam-haskell#readme> for more information.
bug-reports: https://github.com/oscar-h64/pam-haskell/issues
category: System, Authentication
tested-with: GHC==8.8.3
homepage: https://github.com/oscar-h64/pam-haskell

extra-source-files:
Setup.hs

extra-doc-files:
README.md
CONTRIBUTING.md
ChangeLog.md

source-repository head
type: git
location: https://github.com/oscar-h64/pam-haskell

library
default-language: Haskell2010

Library
exposed-modules: System.Posix.PAM
System.Posix.PAM.LowLevel
System.Posix.PAM.Types
System.Posix.PAM.Internals

--other-modules: System.Posix.PAM.Internals

extensions: ForeignFunctionInterface

Build-Depends: base >= 4 && < 5
Hs-Source-Dirs: src
Ghc-options: -Wall
build-depends: base >= 4 && < 5
hs-source-dirs: src
ghc-options: -Wall

extra-libraries : pam
extra-libraries: pam

build-tools: c2hs
build-tool-depends: c2hs:c2hs

0 comments on commit 4949171

Please sign in to comment.